mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-12 20:35:19 +00:00
translation also for info name of the model api endpoint
This commit is contained in:
parent
6dddd5d529
commit
3990330e88
1 changed files with 6 additions and 2 deletions
|
|
@ -184,8 +184,10 @@ async def get_all_models(request, refresh: bool = False, user: UserModel = None)
|
||||||
0
|
0
|
||||||
] # Ollama may return model ids in different formats (e.g., 'llama3' vs. 'llama3:7b')
|
] # Ollama may return model ids in different formats (e.g., 'llama3' vs. 'llama3:7b')
|
||||||
):
|
):
|
||||||
|
# This is what is answered in the info part
|
||||||
|
custom_model.name = translate_model_title(custom_model.name, request.headers.get("X-Language")),
|
||||||
if custom_model.is_active:
|
if custom_model.is_active:
|
||||||
model["name"] = translate_model_title(custom_model.name, request.headers.get("X-Language")),
|
model["name"] = custom_model.name
|
||||||
model["info"] = custom_model.model_dump()
|
model["info"] = custom_model.model_dump()
|
||||||
|
|
||||||
# Set action_ids and filter_ids
|
# Set action_ids and filter_ids
|
||||||
|
|
@ -234,10 +236,12 @@ async def get_all_models(request, refresh: bool = False, user: UserModel = None)
|
||||||
filter_ids.extend(meta["filterIds"])
|
filter_ids.extend(meta["filterIds"])
|
||||||
|
|
||||||
custom_model.name = translate_model_title(custom_model.name, request.headers.get("X-Language"))
|
custom_model.name = translate_model_title(custom_model.name, request.headers.get("X-Language"))
|
||||||
|
# This is what is answered in general endpoint part
|
||||||
models.append(
|
models.append(
|
||||||
{
|
{
|
||||||
"id": f"{custom_model.id}",
|
"id": f"{custom_model.id}",
|
||||||
"name": translate_model_title(custom_model.name, request.headers.get("X-Language")),
|
"name": custom_model.name,
|
||||||
|
"current_language" : custom_model.name,
|
||||||
"object": "model",
|
"object": "model",
|
||||||
"created": custom_model.created_at,
|
"created": custom_model.created_at,
|
||||||
"owned_by": owned_by,
|
"owned_by": owned_by,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue