Mark-Lasfar
commited on
Commit
·
00269b2
1
Parent(s):
509531f
endpoints.py generation.py
Browse files- utils/generation.py +2 -2
utils/generation.py
CHANGED
|
@@ -106,8 +106,8 @@ def select_model(query: str, input_type: str = "text", preferred_model: Optional
|
|
| 106 |
r"\bimage\s+edit\b", r"\bتحرير\s+صورة\b"
|
| 107 |
]
|
| 108 |
for pattern in image_patterns:
|
| 109 |
-
|
| 110 |
-
model = CLIP_LARGE_MODEL if preferred_model == "image_advanced" else CLIP_BASE_MODEL
|
| 111 |
logger.info(f"Selected {model} with endpoint {IMAGE_INFERENCE_API} for image-related query: {query[:50]}...")
|
| 112 |
return model, f"{IMAGE_INFERENCE_API}/{model}"
|
| 113 |
for pattern in image_gen_patterns:
|
|
|
|
| 106 |
r"\bimage\s+edit\b", r"\bتحرير\s+صورة\b"
|
| 107 |
]
|
| 108 |
for pattern in image_patterns:
|
| 109 |
+
if re.search(pattern, query_lower, re.IGNORECASE):
|
| 110 |
+
model = CLIP_LARGE_MODEL if preferred_model == "image_advanced" else CLIP_BASE_MODEL # ← هنا زودت 4 مسافات
|
| 111 |
logger.info(f"Selected {model} with endpoint {IMAGE_INFERENCE_API} for image-related query: {query[:50]}...")
|
| 112 |
return model, f"{IMAGE_INFERENCE_API}/{model}"
|
| 113 |
for pattern in image_gen_patterns:
|