Merge pull request #3668 from open-webui/dev

dev
This commit is contained in:
Timothy Jaeryang Baek
2024-07-05 22:29:13 -07:00
committed by GitHub
13 changed files with 214 additions and 68 deletions

View File

@@ -999,12 +999,16 @@ async def get_all_models():
model["info"] = custom_model.model_dump()
else:
owned_by = "openai"
pipe = None
for model in models:
if (
custom_model.base_model_id == model["id"]
or custom_model.base_model_id == model["id"].split(":")[0]
):
owned_by = model["owned_by"]
if "pipe" in model:
pipe = model["pipe"]
break
models.append(
@@ -1016,11 +1020,11 @@ async def get_all_models():
"owned_by": owned_by,
"info": custom_model.model_dump(),
"preset": True,
**({"pipe": pipe} if pipe is not None else {}),
}
)
app.state.MODELS = {model["id"]: model for model in models}
webui_app.state.MODELS = app.state.MODELS
return models