Explorar o código

fix: openai audio revert

Timothy Jaeryang Baek hai 3 semanas
pai
achega
8339f59cdf
Modificáronse 1 ficheiros con 3 adicións e 8 borrados
  1. 3 8
      backend/open_webui/routers/audio.py

+ 3 - 8
backend/open_webui/routers/audio.py

@@ -337,10 +337,7 @@ async def speech(request: Request, user=Depends(get_verified_user)):
                 timeout=timeout, trust_env=True
             ) as session:
                 r = await session.post(
-                    url=urljoin(
-                        request.app.state.config.TTS_OPENAI_API_BASE_URL,
-                        "/audio/speech",
-                    ),
+                    url=f"{request.app.state.config.TTS_OPENAI_API_BASE_URL}/audio/speech",
                     json=payload,
                     headers={
                         "Content-Type": "application/json",
@@ -468,10 +465,8 @@ async def speech(request: Request, user=Depends(get_verified_user)):
                 timeout=timeout, trust_env=True
             ) as session:
                 async with session.post(
-                    urljoin(
-                        base_url or f"https://{region}.tts.speech.microsoft.com",
-                        "/cognitiveservices/v1",
-                    ),
+                    (base_url or f"https://{region}.tts.speech.microsoft.com")
+                    + "/cognitiveservices/v1",
                     headers={
                         "Ocp-Apim-Subscription-Key": request.app.state.config.TTS_API_KEY,
                         "Content-Type": "application/ssml+xml",