bep40 commited on
Commit
cf30bdd
·
verified ·
1 Parent(s): c93bc67

probe: more candidate models + full error

Browse files
Files changed (1) hide show
  1. ai_ext.py +6 -4
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
- cand = QWEN_TEXT_MODELS + [QWEN_VL_MODEL, "Qwen/Qwen2.5-VL-7B-Instruct",
538
- "meta-llama/Llama-3.1-8B-Instruct", "google/gemma-2-9b-it",
539
- "mistralai/Mistral-7B-Instruct-v0.3", "Qwen/Qwen2.5-32B-Instruct"]
 
 
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))[:140]})
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