support mp3 from api

This commit is contained in:
Concedo
2026-06-19 10:26:34 +08:00
parent 2bc18617ba
commit 6f4325ac87
2 changed files with 7 additions and 4 deletions
+1 -1
View File
@@ -893,7 +893,7 @@ static void mtp_decoding_setup(llama_model * main_model, llama_context * main_ct
}
draft_is_mtp = true;
speculative_state_setup(main_ctx, mtp_ctx_params, static_cast<int32_t>(main_model->n_gpu_layers()), COMMON_SPECULATIVE_TYPE_DRAFT_MTP);
speculative_state_setup(main_ctx, mtp_ctx_params, -1, COMMON_SPECULATIVE_TYPE_DRAFT_MTP);
}
//loads a model for speculative decoding.
+6 -3
View File
@@ -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")