From 519e27978fac02fe97d27fee4db9e3f3860949da Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Mon, 5 Feb 2024 22:58:02 -0800 Subject: [PATCH] refac --- backend/apps/openai/main.py | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/backend/apps/openai/main.py b/backend/apps/openai/main.py index ee83979a..bed9181a 100644 --- a/backend/apps/openai/main.py +++ b/backend/apps/openai/main.py @@ -81,9 +81,6 @@ async def speech(request: Request, user=Depends(get_current_user)): body = await request.body() - print(body) - print(type(body)) - name = hashlib.sha256(body).hexdigest() SPEECH_CACHE_DIR = Path(CACHE_DIR).joinpath("./audio/speech/") @@ -91,8 +88,6 @@ async def speech(request: Request, user=Depends(get_current_user)): file_path = SPEECH_CACHE_DIR.joinpath(f"{name}.mp3") file_body_path = SPEECH_CACHE_DIR.joinpath(f"{name}.json") - print(file_path) - # Check if the file already exists in the cache if file_path.is_file(): return FileResponse(file_path) @@ -110,8 +105,6 @@ async def speech(request: Request, user=Depends(get_current_user)): stream=True, ) - print(r) - r.raise_for_status() # Save the streaming content to a file @@ -125,12 +118,6 @@ async def speech(request: Request, user=Depends(get_current_user)): # Return the saved file return FileResponse(file_path) - # return StreamingResponse( - # r.iter_content(chunk_size=8192), - # status_code=r.status_code, - # headers=dict(r.headers), - # ) - except Exception as e: print(e) error_detail = "Ollama WebUI: Server Connection Error"