mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-16 03:47:49 +01:00
refac
This commit is contained in:
@@ -329,12 +329,13 @@ def merge_ollama_models_lists(model_lists):
|
|||||||
for idx, model_list in enumerate(model_lists):
|
for idx, model_list in enumerate(model_lists):
|
||||||
if model_list is not None:
|
if model_list is not None:
|
||||||
for model in model_list:
|
for model in model_list:
|
||||||
id = model["model"]
|
id = model.get("model")
|
||||||
if id not in merged_models:
|
if id is not None:
|
||||||
model["urls"] = [idx]
|
if id not in merged_models:
|
||||||
merged_models[id] = model
|
model["urls"] = [idx]
|
||||||
else:
|
merged_models[id] = model
|
||||||
merged_models[id]["urls"].append(idx)
|
else:
|
||||||
|
merged_models[id]["urls"].append(idx)
|
||||||
|
|
||||||
return list(merged_models.values())
|
return list(merged_models.values())
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user