mirror of
https://github.com/LostRuins/koboldcpp.git
synced 2026-09-19 09:15:18 +02:00
qwen3tts support languages
This commit is contained in:
@@ -505,6 +505,7 @@ class tts_generation_inputs(ctypes.Structure):
|
||||
("custom_speaker_data", ctypes.c_char_p),
|
||||
("reference_audio", ctypes.c_char_p),
|
||||
("speaker_instruction", ctypes.c_char_p),
|
||||
("language", ctypes.c_char_p),
|
||||
("use_mp3", ctypes.c_bool)]
|
||||
|
||||
class tts_generation_outputs(ctypes.Structure):
|
||||
@@ -3068,10 +3069,12 @@ def tts_generate(genparams):
|
||||
inputs = tts_generation_inputs()
|
||||
inputs.custom_speaker_voice = normalized_voice.encode("UTF-8")
|
||||
ttsinstruction = genparams.get("instruction", "")
|
||||
ttslang = genparams.get("language", "en")
|
||||
# if no instruction provided, extract from text
|
||||
if not genparams.get("instruction", ""):
|
||||
prompt, ttsinstruction = tts_extract_instruction(prompt)
|
||||
inputs.speaker_instruction = ttsinstruction.encode("UTF-8")
|
||||
inputs.language = ttslang.encode("UTF-8")
|
||||
response_format_mp3 = True if (genparams.get("response_format")=="mp3") else False
|
||||
inputs.use_mp3 = genparams.get("use_mp3", response_format_mp3)
|
||||
inputs.prompt = prompt.encode("UTF-8")
|
||||
|
||||
Reference in New Issue
Block a user