When HF_HUB_OFFLINE is set to a truthy value (1, true, yes, on),
download_model() should treat local_files_only=True to avoid any
network calls. Currently, even with the local-cache-first pass (which
may fail due to missing metadata), the retry loop still calls
download_files_from_huggingface() without local_files_only, which
triggers model_info() — a network API call that immediately fails in
offline mode. This causes an unnecessary fallback to GCS download from
storage.googleapis.com.
By setting local_files_only=True when HF_HUB_OFFLINE is enabled:
1. The HF local cache pass works if the model is cached
2. The retry loop skips the network-dependent HF path entirely
3. retrieve_model_gcs() only checks for local fast-* directories
4. No network calls are attempted at all
The truthy value check aligns with huggingface_hub's own parsing of
HF_HUB_OFFLINE, which accepts "1", "true", "yes", "on" (case-insensitive).
This is critical for air-gapped / restricted environments where both
HuggingFace and Google Cloud Storage are unreachable.
Made-with: Cursor
* new: drop python3.9, replace optional and union with |
* new: remove python 3.9 from pyproject
* refactor: replace remaining union and optional with |
* new: remove optional and union in dataclasses
* fix: add typealias to numpy type
* new: replace union with | in token count
* tests: introduce model cache to tests
* fix: fix not cached model deletion
* new: do not run CI tests on mac os and windows on python 3.10-3.12
* fix: lowercase cache keys, bm25 caching
* tests: do not run parallel processing on all cpus in sparse text embed
* fix: fix models to cache names, do not run parallel=0
* fix: fix sparse embedding tests
* fix: bm42 language by lower case model name
* Custom rerankers support
* Test for reranker_custom_model
* test fix
* Model description type fix
* Test fix
* fix: fix naming
* fix: remove redundant arg from tests
* new: update readme
---------
Co-authored-by: George Panchuk <george.panchuk@qdrant.tech>
* chore: Trigger CI test
* chore: Trigger CI test
* chore: Trigger CI test
* chore: Trigger CI test
* chore: Trigger CI test
* chore: Trigger CI test
* chore: Trigger CI test
* chore: Trigger CI test
* chore: Trigger CI test
* Trigger CI
* Trigger CI
* Trigger CI
* Trigger CI test
* Trigger CI test
* Trigger CI test
* Trigger CI test
* Trigger CI test
* Trigger CI test
* Trigger CI test
* Trigger CI test
* Trigger CI test
* Trigger CI test
* Trigger CI test
* Trigger CI test
* Trigger CI test
* Trigger CI test
* Trigger CI test
* Trigger CI test
* Trigger CI test
* Trigger CI test
* Trigger CI test
* Trigger CI test
* Trigger CI test
* Trigger CI test
* Trigger CI test
* Trigger CI test
* Trigger CI test
* Trigger CI test
* new: Added on workflow dispatch
* tests: Updated tests
* fix: Fix CI
* fix: Fix CI
* fix: Fix CI
* improve: Prevent stop iteration error caused by next
* fix: Fix variable might be referenced before assignment
* refactor: Revised the way of getting models to test
* fix: Fix test in image model
* refactor: Call one model
* fix: Fix ci
* fix: Fix splade model name
* tests: Updated tests
* chore: Remove cache
* tests: Update multi task tests
* tests: Update multi task tests
* tests: Updated tests
* refactor: refactor utils func, add comments, conditions refactor
---------
Co-authored-by: George Panchuk <george.panchuk@qdrant.tech>