Commit 62c0762
Fix GGUF quant label parsing for Unsloth Dynamic (UD) prefixed filenames (#1975)
## Summary
- GGUF filenames with the [Unsloth Dynamic "UD-" prefix
](https://unsloth.ai/docs/basics/unsloth-dynamic-2.0-ggufs)(e.g.
`Qwen3-4B-UD-Q2_K_XL.gguf`) have their quant labels parsed, but the
"UD-" prefix gets dropped — so `parseGGUFQuantLabel` returns `"Q2_K_XL"`
instead of `"UD-Q2_K_XL"`. This means the "Hardware compatibility"
section on model pages like https://huggingface.co/unsloth/Qwen3-4B-GGUF
doesn't distinguish UD quants from regular ones.
- Updates `GGUF_QUANT_RE` to capture an optional `(?<prefix>UD-)?` named
group before the quant type, so `parseGGUFQuantLabel` now returns
`"UD-Q2_K_XL"` preserving the full label.
- Adds a test case in `gguf.spec.ts` for the UD-prefixed filename
pattern.
<img width="484" height="346" alt="image"
src="https://github.com/user-attachments/assets/30e922ff-7000-49a0-acb8-a7cf69ef2d3e"
/>
Co-authored-by: Cursor <cursoragent@cursor.com>1 parent 1b2db54 commit 62c0762
2 files changed
+4
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
289 | 289 | | |
290 | 290 | | |
291 | 291 | | |
| 292 | + | |
292 | 293 | | |
293 | 294 | | |
294 | 295 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
57 | 59 | | |
58 | 60 | | |
59 | 61 | | |
| |||
0 commit comments