Skip to content

feat: Hugging Face Hub integration (1/2) - #118

Open
micedre wants to merge 5 commits into
mainfrom
claude/issue-109-20261124-1343
Open

micedre wants to merge 5 commits into
mainfrom
claude/issue-109-20261124-1343

Conversation

@micedre

@micedre micedre commented Nov 24, 2026

Copy link
Copy Markdown
Collaborator

Adds save_pretrained / from_pretrained / push_to_hub via ModelHubMixin with safetensors + JSON (no pickle), optional hub extra, model card generation, version check. Supports standard models with NGramTokenizer; WordPiece/HF tokenizers and docs follow in PR 2. No breaking changes.

Refs #109

Generated with Claude Code

…ined / push_to_hub)

Pickle-free serialization via safetensors + JSON for standard models using
NGramTokenizer. Adds optional 'hub' extra, model card generation, version check.
Refs #109

Co-authored-by: Cédric Couralet <243027+micedre@users.noreply.github.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@claude

claude Bot commented Nov 24, 2026

Copy link
Copy Markdown

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

@micedre

micedre commented Nov 24, 2026

Copy link
Copy Markdown
Collaborator Author

@claude check the failing test

@claude

claude Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

Claude finished @micedre's task in 32s —— View job


CI failure fixed

  • Checked failing CI: the "Python Tests" workflow failed on all three jobs (3.11, 3.12, 3.13) at the Install the project step, so no tests actually ran.
  • Found the cause in the log: error: The lockfile at uv.lock needs to be updated, but --locked was provided. The PR added huggingface_hub and safetensors to pyproject.toml (the dev group and the new hub extra) without regenerating uv.lock.
  • Ran uv lock and pushed the updated uv.lock as ea97856. The diff is small (+13/−3).

The test suite has not been run, either by me or by CI since the push. Please check that the new CI run passes. If tests/test_hub.py fails once the install succeeds, mention me again and I'll look at it.
· branch claude/issue-109-20261124-1343

Co-authored-by: Cédric Couralet <243027+micedre@users.noreply.github.com>

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@micedre

micedre commented Nov 24, 2026

Copy link
Copy Markdown
Collaborator Author

@claude update docs

@claude

claude Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

Claude finished @micedre's task in 42s —— View job


Docs updated for the Hub integration

  • Added a new tutorial, docs/source/tutorials/hub_sharing.md. It covers the hub extra, save_pretrained / from_pretrained / push_to_hub, the saved files, supported model_card_kwargs, version checks and the device argument. It also notes the current limits: NGramTokenizer only, and no from_model custom models.
  • Added a "Hugging Face Hub Sharing" section to getting_started/installation.md.
  • Added the three new methods and a short Hub section to api/wrapper.rst.
  • Added the tutorial to the toctree and a card in tutorials/index.md.

The existing docs files use CRLF line endings. My first commit (3ff3e82) accidentally converted them to LF, so I restored CRLF in e5532ed. The net diff is now +117 lines across 4 files. The history keeps both commits, so squash them if you want it cleaner.

I did not build the Sphinx docs or run the tests, so the new page and cross-references are untested.

The PR description says docs follow in PR 2. These edits now sit in this PR, so you may want to drop them from the PR 2 plan.
· branch claude/issue-109-20261124-1343

github-actions Bot and others added 3 commits November 24, 2026 14:15
Co-authored-by: Cédric Couralet <243027+micedre@users.noreply.github.com>

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-authored-by: Cédric Couralet <243027+micedre@users.noreply.github.com>

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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.

2 participants