mirror of
https://github.com/open-webui/open-webui
synced 2024-11-17 05:53:11 +00:00
refac: ollama connections
This commit is contained in:
parent
99446c4b76
commit
08b5e7ef5b
@ -263,12 +263,12 @@ def merge_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:
|
||||||
digest = model["digest"]
|
id = model["model"]
|
||||||
if digest not in merged_models:
|
if id not in merged_models:
|
||||||
model["urls"] = [idx]
|
model["urls"] = [idx]
|
||||||
merged_models[digest] = model
|
merged_models[id] = model
|
||||||
else:
|
else:
|
||||||
merged_models[digest]["urls"].append(idx)
|
merged_models[id]["urls"].append(idx)
|
||||||
|
|
||||||
return list(merged_models.values())
|
return list(merged_models.values())
|
||||||
|
|
||||||
@ -312,6 +312,8 @@ async def get_all_models():
|
|||||||
for model in response["models"]:
|
for model in response["models"]:
|
||||||
model["model"] = f"{prefix_id}.{model['model']}"
|
model["model"] = f"{prefix_id}.{model['model']}"
|
||||||
|
|
||||||
|
print(responses)
|
||||||
|
|
||||||
models = {
|
models = {
|
||||||
"models": merge_models_lists(
|
"models": merge_models_lists(
|
||||||
map(
|
map(
|
||||||
|
Loading…
Reference in New Issue
Block a user