fix: hwfit params_b/is_prequantized crash on non-string catalog fields (#2094)

This commit is contained in:
Afonso Coutinho
2026-07-11 03:00:28 +01:00
committed by GitHub
parent a8d215a390
commit 7a1c7395c0
2 changed files with 33 additions and 2 deletions
+2 -2
View File
@@ -145,7 +145,7 @@ def is_prequantized(model):
or re.search(r"(^|[-_/])fp8($|[-_/\s])", text) is not None
or (not (model.get("is_gguf") or model.get("gguf_sources")) and re.search(r"(^|[-_/])(?:int)?8bit($|[-_/\s])", text) is not None)
or any(x in text for x in ("awq", "gptq", "mlx"))
or any(q.startswith(p) for p in PREQUANTIZED_PREFIXES)
or any(isinstance(q, str) and q.startswith(p) for p in PREQUANTIZED_PREFIXES)
)
@@ -155,7 +155,7 @@ def params_b(model):
return raw / 1_000_000_000.0
pc = model.get("parameter_count", "")
if pc:
if isinstance(pc, str) and pc:
pc = pc.strip().upper()
m = re.match(r"^([\d.]+)\s*([BKMGT]?)$", pc)
if m: