portal: filter image-gen models from chat picker by name (gateway strips mode from /v1/models)
This commit is contained in:
1 parent
5091c9e644
commit
ced82b09d0
1 file changed
+6
-1
+6
-1
@@ -2017,9 +2017,14 @@ async def list_models(request: Request):
|
|||||||
mid = (m.get("id") or "").lower()
|
mid = (m.get("id") or "").lower()
|
||||||
return any(h in mid for h in embedding_name_hints)
|
return any(h in mid for h in embedding_name_hints)
|
||||||
|
|
||||||
|
image_name_hints = ("qwen-image",)
|
||||||
|
|
||||||
def is_image_model(m) -> bool:
|
def is_image_model(m) -> bool:
|
||||||
mode = ((m.get("info") or {}).get("meta") or {}).get("mode") or ""
|
mode = ((m.get("info") or {}).get("meta") or {}).get("mode") or ""
|
||||||
return mode in image_modes
|
if mode in image_modes:
|
||||||
|
return True
|
||||||
|
mid = (m.get("id") or "").lower()
|
||||||
|
return any(h in mid for h in image_name_hints)
|
||||||
|
|
||||||
payload["data"] = [
|
payload["data"] = [
|
||||||
m for m in payload.get("data", [])
|
m for m in payload.get("data", [])
|
||||||
|
|||||||
Reference in new issue
Block a user