f5tts/wwwroot/api/infer_stream/index.dspy
2024-12-25 16:04:39 +08:00

8 lines
221 B
Plaintext

debug(f'{params_kw=}')
async def g():
speaker = params_kw.speaker or 'main'
async for d in infer_stream(params_kw.prompt, speaker):
yield entire_url('/idfile') + f'?path={d}'
return await stream_response(request, g)