From 26276b2a59e2fc270c814966f967edf1c53a864d Mon Sep 17 00:00:00 2001 From: Kye Date: Tue, 16 Apr 2024 17:19:35 -0400 Subject: [PATCH] [RETURN BOTH] --- text_to_video.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/text_to_video.py b/text_to_video.py index 1d7805e..48a4368 100644 --- a/text_to_video.py +++ b/text_to_video.py @@ -145,8 +145,9 @@ async def create_chat_completion( media_type="image/gif", filename=request.output_path ) - - return JSONResponse(content=log.model_dump(), status_code=200) + out = JSONResponse(content=log.model_dump(), status_code=200) + saved_file = FileResponse(response, media_type="image/gif", filename=request.output_path) + return out, saved_file except Exception as e: logger.error(f"Error: {e}") raise HTTPException(status_code=500, detail="Internal Server Error")