mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-16 20:07:49 +01:00
feat: model filter frontend integration
This commit is contained in:
@@ -196,9 +196,11 @@ async def get_models(url_idx: Optional[int] = None, user=Depends(get_current_use
|
||||
models = await get_all_models()
|
||||
if app.state.MODEL_FILTER_ENABLED:
|
||||
if user.role == "user":
|
||||
models["data"] = filter(
|
||||
lambda model: model["id"] in app.state.MODEL_LIST,
|
||||
models["data"],
|
||||
models["data"] = list(
|
||||
filter(
|
||||
lambda model: model["id"] in app.state.MODEL_LIST,
|
||||
models["data"],
|
||||
)
|
||||
)
|
||||
return models
|
||||
return models
|
||||
|
||||
Reference in New Issue
Block a user