Spaces:
Running
Running
probe: more candidate models + full error
Browse files
ai_ext.py
CHANGED
|
@@ -534,9 +534,11 @@ async def api_ai_probe():
|
|
| 534 |
import time as _t
|
| 535 |
tok = _hf_token()
|
| 536 |
out = []
|
| 537 |
-
|
| 538 |
-
|
| 539 |
-
|
|
|
|
|
|
|
| 540 |
seen = set()
|
| 541 |
for m in cand:
|
| 542 |
if not m or m in seen:
|
|
@@ -548,7 +550,7 @@ async def api_ai_probe():
|
|
| 548 |
r = await c.chat_completion(model=m, messages=[{"role": "user", "content": "Trả lời đúng 1 từ: xin chào"}], max_tokens=10)
|
| 549 |
out.append({"model": m, "ok": True, "sec": round(_t.time() - t0, 1), "txt": (r.choices[0].message.content or "")[:30]})
|
| 550 |
except Exception as e:
|
| 551 |
-
out.append({"model": m, "ok": False, "sec": round(_t.time() - t0, 1), "err": (type(e).__name__ + ": " + str(e))[:
|
| 552 |
return JSONResponse({"results": out})
|
| 553 |
|
| 554 |
|
|
|
|
| 534 |
import time as _t
|
| 535 |
tok = _hf_token()
|
| 536 |
out = []
|
| 537 |
+
extra = os.getenv("PROBE_MODELS", "").split(",")
|
| 538 |
+
cand = [m.strip() for m in extra if m.strip()] + [
|
| 539 |
+
"Qwen/Qwen2.5-VL-7B-Instruct", "Qwen/Qwen2.5-VL-3B-Instruct", "Qwen/Qwen2-VL-7B-Instruct",
|
| 540 |
+
"Qwen/Qwen2.5-VL-72B-Instruct", "Qwen/Qwen3-8B", "Qwen/Qwen3-4B", "Qwen/Qwen3-32B",
|
| 541 |
+
"Qwen/Qwen2.5-7B-Instruct-1M", "meta-llama/Llama-3.2-3B-Instruct"]
|
| 542 |
seen = set()
|
| 543 |
for m in cand:
|
| 544 |
if not m or m in seen:
|
|
|
|
| 550 |
r = await c.chat_completion(model=m, messages=[{"role": "user", "content": "Trả lời đúng 1 từ: xin chào"}], max_tokens=10)
|
| 551 |
out.append({"model": m, "ok": True, "sec": round(_t.time() - t0, 1), "txt": (r.choices[0].message.content or "")[:30]})
|
| 552 |
except Exception as e:
|
| 553 |
+
out.append({"model": m, "ok": False, "sec": round(_t.time() - t0, 1), "err": (type(e).__name__ + ": " + str(e))[-300:]})
|
| 554 |
return JSONResponse({"results": out})
|
| 555 |
|
| 556 |
|