llama.cpp icon indicating copy to clipboard operation
llama.cpp copied to clipboard

Refactor: convert_hf_to_gguf.py

Open pwilkin opened this issue 1 month ago • 5 comments

From the creators of the horror show "llama-model.cpp - refactoring" comes the sequel: "convert_hf_to_gguf.py - refactoring".

Still in draft because it's not all finished, but I thought that if someone wanted to chime in I'll put it up already.

pwilkin avatar Nov 09 '25 01:11 pwilkin

:exploding_head: Looks like a decent enough plan though. Only downside is that there will no longer just be a single script to grab and run, but that has been a source of error and confusion anyway.

You should derive _MODEL_MODULES from models_map.

CISC avatar Nov 09 '25 08:11 CISC

@compilade Your input would be much appreciated as well.

CISC avatar Nov 09 '25 08:11 CISC

(note for later) This will (trivially) conflict with at least

  • #17069
  • #15667
  • #15727
  • (non-existent yet, but wip) convert : generalized repacking for pre-quantized models

compilade avatar Nov 09 '25 14:11 compilade

  • #17069
  • #15667

Are you expecting more work on these? Can be merged now.

CISC avatar Nov 09 '25 14:11 CISC

Okay, so I've actually gone over and verified the conversion results - refactored, applied some tips from here while doing that and most of all - tested that it actually works.

pwilkin avatar Nov 12 '25 00:11 pwilkin

Conversion verification script: https://gist.github.com/pwilkin/1e488423e9f2549c0518179bb9f752d5

pwilkin avatar Nov 18 '25 16:11 pwilkin

@CISC have fun! :)

pwilkin avatar Nov 18 '25 16:11 pwilkin

@CISC have fun! :)

You need to fix the CIs first, esp. convert_hf_to_gguf_update.py. :)

CISC avatar Nov 18 '25 16:11 CISC

Yeah, might've went out of draft too early :>

pwilkin avatar Nov 18 '25 17:11 pwilkin