Skip to content

feat: generate model card on local save (#258)#388

Open
umran666 wants to merge 3 commits into
p-e-w:masterfrom
umran666:feat/issue-258-local-model-card
Open

feat: generate model card on local save (#258)#388
umran666 wants to merge 3 commits into
p-e-w:masterfrom
umran666:feat/issue-258-local-model-card

Conversation

@umran666

Copy link
Copy Markdown
Contributor

I Noticed that if someone hits "Save to local folder", the model card/README gets entirely skipped and only the weights drop.

To fix it without duplicating any code, I just pulled the ModelCard generation logic out of the HF upload block into a clean create_model_card() helper function over in utils.py.
Now the local save routine just hits that exact same helper to automatically drop the README.md right next to the local weight files. Works perfectly and keeps the HF upload logic a lot cleaner too! Let me know if you need anything tweaked.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors the model card creation logic by introducing a helper function create_model_card in src/heretic/utils.py and using it in src/heretic/main.py both when saving the model locally and when pushing it to the Hugging Face Hub. Feedback was provided to improve the robustness of create_model_card by handling potential exceptions during model card loading and preventing a TypeError when card.text is None.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread src/heretic/utils.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant