mirror of
https://github.com/LostRuins/koboldcpp.git
synced 2026-09-19 09:15:18 +02:00
support mp3 from api
This commit is contained in:
+6
-3
@@ -3000,7 +3000,8 @@ def tts_generate(genparams):
|
||||
if not genparams.get("instruction", ""):
|
||||
prompt, ttsinstruction = tts_extract_instruction(prompt)
|
||||
inputs.speaker_instruction = ttsinstruction.encode("UTF-8")
|
||||
inputs.use_mp3 = genparams.get("use_mp3", False)
|
||||
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")
|
||||
inputs.speaker_seed = voice
|
||||
aseed = -1
|
||||
@@ -3089,7 +3090,8 @@ def music_generate_codes(genparams):
|
||||
inputs = music_generation_inputs()
|
||||
inputs.is_planner_mode = True
|
||||
inputs.stereo = genparams.get('stereo', True)
|
||||
inputs.use_mp3 = genparams.get('use_mp3', False)
|
||||
response_format_mp3 = True if (genparams.get("response_format")=="mp3") else False
|
||||
inputs.use_mp3 = genparams.get("use_mp3", response_format_mp3)
|
||||
inputs.gen_codes = genparams.get('gen_codes', False)
|
||||
inputs.rewrite_caption = genparams.get('rewrite_caption', True)
|
||||
inputs.input_json = input_json.encode("UTF-8")
|
||||
@@ -3107,7 +3109,8 @@ def music_generate_audio(genparams):
|
||||
inputs = music_generation_inputs()
|
||||
inputs.is_planner_mode = False
|
||||
inputs.stereo = genparams.get('stereo', True)
|
||||
inputs.use_mp3 = genparams.get('use_mp3', False)
|
||||
response_format_mp3 = True if (genparams.get("response_format")=="mp3") else False
|
||||
inputs.use_mp3 = genparams.get("use_mp3", response_format_mp3)
|
||||
inputs.gen_codes = genparams.get('gen_codes', False)
|
||||
inputs.rewrite_caption = genparams.get('rewrite_caption', True)
|
||||
inputs.input_json = input_json.encode("UTF-8")
|
||||
|
||||
Reference in New Issue
Block a user