async def g(): async for d in infer_stream(params_kw.prompt): nd = d.get('audio') if nd: yield nd try: resp = await stream_response(request, g, content_type='audio/mpeg') return resp except Exception as e: exc = format_exc() exception(f'{e=}\n{exc}') return { "status":"error", "message":str(e) }