Skip to content
Claude CodefeatureData & ML16 files · +1360 −484

Push fine-tuned MiniCPM-V invoice model to HuggingFace and fix inference format

Session from kirana-detective-build-traces on Hugging Face by build-small-hackathon · MIT · condensed by Coders Talk

1h 07msession
1interventions
GOAL

Push a fine-tuned MiniCPM-V 4.6 LoRA adapter from a Modal volume to the developer's personal HuggingFace namespace, update the professional model card, and make the model format compatible with the app's inference stack.

  1. Prompt · +0
    Push trained MiniCPM-V model from Modal storage to HuggingFace repo naazimsnh02 (org token lacked rights), and update the professional model card with training details.
  2. Agent did · +0m
    Investigated training script and existing model cards, wrote a dedicated push script targeting naazimsnh02, updated MODEL_CARD.md with real training metrics, and after fixing an f-string brace bug and a Windows encoding error, successfully pushed the LoRA adapter to HuggingFace.
  3. Prompt · +9m
    Check whether the model should be pushed as adapter or full/GGUF for the app's inference stack, per the PRD; then replace with GGUF like the other model.
  4. Agent did · +9m
    Found the app uses llama-cpp-python not vLLM/transformers, so the LoRA adapter alone can't be used; wrote an export script to merge the LoRA and convert to GGUF, but hit repeated errors including CUDA build failures and finally that MiniCPM-V-4.6's architecture (MiniCPMV4_6Model) is not supported by llama.cpp's converter.
  5. Fail · +23m
    convert_hf_to_gguf.py errors with 'Model MiniCPMV4_6Model is not supported' — llama.cpp has no converter support for this architecture at all.
  6. Intervention · +38m
    Developer modified app.py and export_minicpm_v_gguf.py themselves to try an alternate approach (reusing OpenBMB's base GGUF + LoRA-to-GGUF conversion) and asked the agent to review it.
    Why: I wanted to try downloading the official OpenBMB GGUF and just converting the LoRA on top instead of the whole model, since full conversion was clearly blocked.
  7. Fail · +49m
    Both the LoRA-to-GGUF conversion and a fresh attempt at converting the merged model to GGUF hit the same 'MiniCPMV4_6Model is not supported' wall, confirming no GGUF path exists for this architecture yet.
  8. Agent did · +1h 2m
    Abandoned GGUF entirely; switched invoice_extractor.py and app.py to load the merged HF model directly via transformers instead of llama-cpp-python, raised the inference timeout for CPU, and cleaned up repo references.
  9. Prompt · +1h 4m
    Keep naazimsnh02 for all creation/training scripts, but have the app and docs point to build-small-hackathon since models get moved there manually after creation; update all docs to match.
  10. Agent did · +1h 4m
    Swept app.py, all three agent files, README.md, MODEL_CARD.md, the PRD, and .kiro spec files, splitting references so creation scripts point to naazimsnh02 and runtime/docs point to build-small-hackathon; verified no stray references remained.
  11. Outcome · +1h 7m
    Wrote a new professional model card and push script for the merged model repo; session ended with the developer needing to set HF_TOKEN on Windows before running the final push — card not yet confirmed pushed.
VERDICT

Next time I'd start by checking the app's actual inference stack (llama-cpp-python, not vLLM) before pushing any model format, since that assumption cost a lot of back-and-forth on GGUF conversion that turned out to be a dead end for MiniCPM-V-4.6. The correction that actually unblocked things was giving up on GGUF and switching the app to load the merged HF model via transformers directly — everything after that went smoothly.

I tried this · 0

Discussion · 0

How Builds work