hf-hub icon indicating copy to clipboard operation
hf-hub copied to clipboard

fix(metadata): check content size by linked size and head content-length as fallback

Open greenhat616 opened this issue 2 months ago • 0 comments

This is pr is intented to keep the same behavior with https://github.com/huggingface/huggingface_hub/blob/main/src/huggingface_hub/file_download.py#L1408

Background

In China mainland, we mostly use hf-mirror.com as mirror endpoint, which serves range stream without Content-Range header causing hf-hub Missing Header Error

Furthermore

Might we consider RANGE GET request failed and Content-Range is not available, and fallback to HEAD request?

greenhat616 avatar Oct 15 '25 06:10 greenhat616