fix(scripts): upload README.md in upload_hf.py - #116
Open
agourakis82 wants to merge 2 commits into
Open
agourakis82 wants to merge 2 commits into
agourakis82 wants to merge 2 commits into
Conversation
The upload-file listing explicitly excluded README.md ("README usually
already uploaded; skip leftovers handled below"), but nothing below
handled leftovers -- the README is simply never uploaded. Given a
checkpoint directory of README.md, config.json, and model.safetensors,
only config.json and model.safetensors were recorded as uploaded.
Removes the exclusion and extracts the listing into files_to_upload()
so the file-selection rule (dotfiles and .bak_vision backups excluded,
everything else included) is independently testable without touching
the network.
Fixes Edge0-AI#103.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Adapt the README upload fix to the python/ layout. Isolate import-time patches with private test dependencies and cover file selection plus fake-API CLI wiring for both tiers. Validation: two CLI regression cases reject unmodified main; six upload and four available-checkout hygiene tests pass on the exact patch in the cluster. No real uploads, model inference, numerical checks or full-suite rerun. Assisted-by: Codex LLM-offload-review: GPT-6-Astra; read-only diff and public-body review; no blockers.
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The focused fix preserves existing filtering behavior and is adequately covered by isolated tests.
Review effort: Balanced
Findings: None
What changed in this PR
Ensures checkpoint model cards are included in Hugging Face uploads.
Changes:
- Extracts deterministic upload-file selection and includes
README.md. - Adds isolated selection and CLI wiring tests for both model tiers.
| File | Description |
|---|---|
python/scripts/upload_hf.py |
Adds reusable file selection and uploads README files. |
python/tests/test_upload_hf.py |
Tests filtering, sorting, and upload API arguments. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #103.
python/scripts/upload_hf.pyexcludedREADME.mdfrom the upload list with acomment suggesting it was handled later, but no later path uploaded it. A
checkpoint's model card was therefore omitted.
Changes
README.mdby extracting the existing selection rules intofiles_to_upload()and calling it frommain()..bak_visionexclusions. Directory and symlink behavior is otherwiseunchanged.
python/layout while preserving its history.model tiers. Private dependency stubs and pytest monkeypatch restoration
keep import-time environment and transport changes out of other tests.
Validation
On unmodified upstream main
feafe31beadf662b18f7c02d5e4689d2203e8072,the two new CLI wiring cases fail because the upload calls omit
README.md.With this patch, six upload tests and four repository-hygiene tests pass
on Linux with the existing pytest installation. The checkout materializes
docs/andpython/; hygiene checks cover files present in that checkout.From the repository root, the focused check is reproducible with:
git diff --checkpasses for the contribution relative to upstream main.Local validation did not run real Hugging Face uploads, network-behavior
tests, MLX inference, numerical calculations, GPU or performance tests, or
the full suite. New-head upstream CI will be checked separately after
publication.