Ver Fonte

chore: format

Timothy Jaeryang Baek há 4 semanas atrás
pai
commit
485392fe63

+ 5 - 2
backend/open_webui/retrieval/loaders/main.py

@@ -178,7 +178,11 @@ class DoclingLoader:
 
                 params["force_ocr"] = self.params.get("force_ocr")
 
-                if self.params.get("do_ocr") and self.params.get("ocr_engine") and self.params.get("ocr_lang"):
+                if (
+                    self.params.get("do_ocr")
+                    and self.params.get("ocr_engine")
+                    and self.params.get("ocr_lang")
+                ):
                     params["ocr_engine"] = self.params.get("ocr_engine")
                     params["ocr_lang"] = [
                         lang.strip()
@@ -195,7 +199,6 @@ class DoclingLoader:
                 if self.params.get("pipeline"):
                     params["pipeline"] = self.params.get("pipeline")
 
-
             endpoint = f"{self.url}/v1/convert/file"
             r = requests.post(endpoint, files=files, data=params)
 

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

@@ -337,7 +337,10 @@ 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=urljoin(
+                        request.app.state.config.TTS_OPENAI_API_BASE_URL,
+                        "/audio/speech",
+                    ),
                     json=payload,
                     headers={
                         "Content-Type": "application/json",
@@ -465,7 +468,10 @@ 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"),
+                    urljoin(
+                        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",

+ 4 - 1
backend/open_webui/routers/ollama.py

@@ -340,7 +340,10 @@ def merge_ollama_models_lists(model_lists):
     return list(merged_models.values())
 
 
-@cached(ttl=MODELS_CACHE_TTL, key=lambda _, user: f"ollama_all_models_{user.id}" if user else "ollama_all_models")
+@cached(
+    ttl=MODELS_CACHE_TTL,
+    key=lambda _, user: f"ollama_all_models_{user.id}" if user else "ollama_all_models",
+)
 async def get_all_models(request: Request, user: UserModel = None):
     log.info("get_all_models()")
     if request.app.state.config.ENABLE_OLLAMA_API: