mirror of
https://github.com/open-webui/open-webui.git
synced 2025-04-12 22:09:06 +02:00
fix: ollama prefix id
This commit is contained in:
parent
6a9978dd12
commit
bb45d35a36
@ -1030,6 +1030,16 @@ async def generate_chat_completion(
|
||||
if ":" not in payload["model"]:
|
||||
payload["model"] = f"{payload['model']}:latest"
|
||||
|
||||
await get_all_models(request)
|
||||
model = request.app.state.OLLAMA_MODELS.get(model_id)
|
||||
if model:
|
||||
url_idx = model["urls"].pop()
|
||||
else:
|
||||
raise HTTPException(
|
||||
status_code=404,
|
||||
detail="Model not found",
|
||||
)
|
||||
|
||||
url = await get_ollama_url(request, payload["model"], url_idx)
|
||||
api_config = request.app.state.config.OLLAMA_API_CONFIGS.get(
|
||||
str(url_idx),
|
||||
|
Loading…
x
Reference in New Issue
Block a user