Skip to content

Commit 485392f

Browse files
committed
chore: format
1 parent cbb4684 commit 485392f

File tree

3 files changed

+17
-5
lines changed

3 files changed

+17
-5
lines changed

backend/open_webui/retrieval/loaders/main.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,11 @@ def load(self) -> list[Document]:
178178

179179
params["force_ocr"] = self.params.get("force_ocr")
180180

181-
if self.params.get("do_ocr") and self.params.get("ocr_engine") and self.params.get("ocr_lang"):
181+
if (
182+
self.params.get("do_ocr")
183+
and self.params.get("ocr_engine")
184+
and self.params.get("ocr_lang")
185+
):
182186
params["ocr_engine"] = self.params.get("ocr_engine")
183187
params["ocr_lang"] = [
184188
lang.strip()
@@ -195,7 +199,6 @@ def load(self) -> list[Document]:
195199
if self.params.get("pipeline"):
196200
params["pipeline"] = self.params.get("pipeline")
197201

198-
199202
endpoint = f"{self.url}/v1/convert/file"
200203
r = requests.post(endpoint, files=files, data=params)
201204

backend/open_webui/routers/audio.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,10 @@ async def speech(request: Request, user=Depends(get_verified_user)):
337337
timeout=timeout, trust_env=True
338338
) as session:
339339
r = await session.post(
340-
url=urljoin(request.app.state.config.TTS_OPENAI_API_BASE_URL, "/audio/speech"),
340+
url=urljoin(
341+
request.app.state.config.TTS_OPENAI_API_BASE_URL,
342+
"/audio/speech",
343+
),
341344
json=payload,
342345
headers={
343346
"Content-Type": "application/json",
@@ -465,7 +468,10 @@ async def speech(request: Request, user=Depends(get_verified_user)):
465468
timeout=timeout, trust_env=True
466469
) as session:
467470
async with session.post(
468-
urljoin(base_url or f"https://{region}.tts.speech.microsoft.com", "/cognitiveservices/v1"),
471+
urljoin(
472+
base_url or f"https://{region}.tts.speech.microsoft.com",
473+
"/cognitiveservices/v1",
474+
),
469475
headers={
470476
"Ocp-Apim-Subscription-Key": request.app.state.config.TTS_API_KEY,
471477
"Content-Type": "application/ssml+xml",

backend/open_webui/routers/ollama.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,10 @@ def merge_ollama_models_lists(model_lists):
340340
return list(merged_models.values())
341341

342342

343-
@cached(ttl=MODELS_CACHE_TTL, key=lambda _, user: f"ollama_all_models_{user.id}" if user else "ollama_all_models")
343+
@cached(
344+
ttl=MODELS_CACHE_TTL,
345+
key=lambda _, user: f"ollama_all_models_{user.id}" if user else "ollama_all_models",
346+
)
344347
async def get_all_models(request: Request, user: UserModel = None):
345348
log.info("get_all_models()")
346349
if request.app.state.config.ENABLE_OLLAMA_API:

0 commit comments

Comments
 (0)