Skip to content

[WIP] Fix errors with hf download command#21

Closed
Copilot wants to merge 1 commit intomasterfrom
copilot/fix-hf-download-errors
Closed

[WIP] Fix errors with hf download command#21
Copilot wants to merge 1 commit intomasterfrom
copilot/fix-hf-download-errors

Conversation

Copy link
Contributor

Copilot AI commented Feb 28, 2026

  • Analyze the issue: huggingface_hub requires ETag header in HEAD responses for file downloads, but the mirror doesn't set it for HuggingFace cache responses
  • Fix huggingface.go: Set ETag header wherever X-Repo-Commit is set (two locations: direct SHA match on line 41, and inside setFromCache closure on line 78)
  • Add tests for the ETag header behavior in HuggingFace header handling
  • Verify the fix builds and passes tests
  • Run code review and CodeQL check
Original prompt

This section details on the original issue you should resolve

<issue_title>Fixes with hf download </issue_title>
<issue_description>```
Traceback (most recent call last): | 0/10 [00:00<?, ?it/s]
File "/opt/homebrew/Cellar/huggingface-cli/1.4.1/libexec/lib/python3.14/site-packages/huggingface_hub/file_download.py", line 1736, in _get_metadata_or_catch_error
raise FileMetadataError(
"Distant resource does not have an ETag, we won't be able to reliably ensure reproducibility."
)
huggingface_hub.errors.FileMetadataError: Distant resource does not have an ETag, we won't be able to reliably ensure reproducibility.


## Comments on the Issue (you are @copilot in this section)

<comments>
</comments>


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot stopped work on behalf of wzshiming due to an error February 28, 2026 07:20
@wzshiming wzshiming closed this Feb 28, 2026
@wzshiming wzshiming deleted the copilot/fix-hf-download-errors branch March 2, 2026 04:39
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.

Fixes with hf download

2 participants