Skip to content

fix(scripts): upload README.md in upload_hf.py - #116

Open
agourakis82 wants to merge 2 commits into
Edge0-AI:mainfrom
agourakis82:fix/upload-hf-readme
Open

agourakis82 wants to merge 2 commits into
Edge0-AI:mainfrom
agourakis82:fix/upload-hf-readme

Conversation

@agourakis82

@agourakis82 agourakis82 commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #103.

python/scripts/upload_hf.py excluded README.md from the upload list with a
comment suggesting it was handled later, but no later path uploaded it. A
checkpoint's model card was therefore omitted.

Changes

  • Include README.md by extracting the existing selection rules into
    files_to_upload() and calling it from main().
  • Keep sorted, top-level regular-file selection and the existing dotfile and
    .bak_vision exclusions. Directory and symlink behavior is otherwise
    unchanged.
  • Update the PR to the current python/ layout while preserving its history.
  • Add self-contained filesystem tests and fake-API CLI wiring tests for both
    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/ and python/; hygiene checks cover files present in that checkout.
    From the repository root, the focused check is reproducible with:

    cd python
    PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 PYTHONDONTWRITEBYTECODE=1 \
      PYTEST_DEBUG_TEMPROOT="$(mktemp -d)" \
      pytest -p no:cacheprovider tests/test_upload_hf.py tests/test_repo_hygiene.py -vv
  • git diff --check passes 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.

agourakis82 and others added 2 commits September 22, 2026 17:18
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.
Copilot AI balanced review requested due to automatic review settings October 3, 2026 19:35

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

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.

scripts/upload_hf.py silently never uploads README.md

2 participants