Timothy J. Baek 1 jaar geleden
bovenliggende
commit
519e27978f
1 gewijzigde bestanden met toevoegingen van 0 en 13 verwijderingen
  1. 0 13
      backend/apps/openai/main.py

+ 0 - 13
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"