@@ -44,26 +44,30 @@ def generate_data(model_output):
44
44
45
45
46
46
@app .get ("/inference_sft" )
47
+ @app .post ("/inference_sft" )
47
48
async def inference_sft (tts_text : str = Form (), spk_id : str = Form ()):
48
49
model_output = cosyvoice .inference_sft (tts_text , spk_id )
49
50
return StreamingResponse (generate_data (model_output ))
50
51
51
52
52
53
@app .get ("/inference_zero_shot" )
54
+ @app .post ("/inference_zero_shot" )
53
55
async def inference_zero_shot (tts_text : str = Form (), prompt_text : str = Form (), prompt_wav : UploadFile = File ()):
54
56
prompt_speech_16k = load_wav (prompt_wav .file , 16000 )
55
57
model_output = cosyvoice .inference_zero_shot (tts_text , prompt_text , prompt_speech_16k )
56
58
return StreamingResponse (generate_data (model_output ))
57
59
58
60
59
61
@app .get ("/inference_cross_lingual" )
62
+ @app .post ("/inference_cross_lingual" )
60
63
async def inference_cross_lingual (tts_text : str = Form (), prompt_wav : UploadFile = File ()):
61
64
prompt_speech_16k = load_wav (prompt_wav .file , 16000 )
62
65
model_output = cosyvoice .inference_cross_lingual (tts_text , prompt_speech_16k )
63
66
return StreamingResponse (generate_data (model_output ))
64
67
65
68
66
69
@app .get ("/inference_instruct" )
70
+ @app .post ("/inference_instruct" )
67
71
async def inference_instruct (tts_text : str = Form (), spk_id : str = Form (), instruct_text : str = Form ()):
68
72
model_output = cosyvoice .inference_instruct (tts_text , spk_id , instruct_text )
69
73
return StreamingResponse (generate_data (model_output ))
0 commit comments