@@ -318,8 +318,8 @@ async def api_generate_stream(request: Request):
318
318
params .pop ("prompt" )
319
319
logger .debug (f"params { params } " )
320
320
generator = worker .generate_stream_gate (params )
321
- background_tasks = create_background_tasks (request_id )
322
- return StreamingResponse (generator , background = background_tasks )
321
+ # background_tasks = create_background_tasks(request_id)
322
+ return StreamingResponse (generator , background = None )
323
323
324
324
325
325
@app .post ("/worker_generate_voice_stream" )
@@ -331,7 +331,7 @@ async def api_generate_stream(request: Request):
331
331
params ["request" ] = request
332
332
logger .debug (f"params { params } " )
333
333
generator = worker .generate_voice_stream (params )
334
- background_tasks = create_background_tasks (request_id )
334
+ # background_tasks = create_background_tasks(request_id)
335
335
response_format = params ["response_format" ]
336
336
content_type = {
337
337
"mp3" : "audio/mpeg" ,
@@ -343,7 +343,7 @@ async def api_generate_stream(request: Request):
343
343
}.get (response_format , f"audio/{ response_format } " )
344
344
return StreamingResponse (
345
345
generator ,
346
- background = background_tasks ,
346
+ background = None ,
347
347
media_type = content_type ,
348
348
headers = {
349
349
"Content-Disposition" : f"attachment; filename=speech.{ response_format } " ,
@@ -365,8 +365,8 @@ async def api_generate(request: Request):
365
365
logger .debug (f"params { params } " )
366
366
output = await worker .generate_gate (params )
367
367
release_worker_semaphore ()
368
- if os .getenv ("backend" ) == "vllm" :
369
- await worker .backend .engine .abort (request_id )
368
+ # if os.getenv("backend") == "vllm":
369
+ # await worker.backend.engine.abort(request_id)
370
370
return JSONResponse (output )
371
371
372
372
0 commit comments