Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
d646442
Stream hf:// files from the CDN to avoid Hub rate limits (#664)
tristan-deep Oct 26, 2026
62e40e6
Validate ZEA_MAX_CONCURRENT_REQUESTS and keep the retry log off the e…
tristan-deep Oct 26, 2026
bde3508
Redact signed URLs in fsspec's HTTP debug log
tristan-deep Oct 26, 2026
1f4122d
fixed potential burst of requests on ttl expiry
Louisvh Oct 29, 2026
4bb3aee
Merge branch 'main' into feature/hf-cdn-streaming
tristan-deep Nov 2, 2026
d3b0c59
improve fetching of small chunks
tristan-deep Nov 2, 2026
e465a91
Keep large chunks on the merged path and make read_at thread-safe
tristan-deep Nov 2, 2026
d378820
Merge remote-tracking branch 'origin/main' into feature/hf-cdn-streaming
tristan-deep Nov 4, 2026
cd2bcb6
Drop cached CDN URLs on upload and reuse branch URLs only as long as …
tristan-deep Nov 4, 2026
206600e
Ask the Hub at most once per cooldown when a URL refresh gives nothin…
tristan-deep Nov 4, 2026
9e9954e
Keep using the current URL when its early refresh fails
tristan-deep Nov 4, 2026
a138178
Redact signed URLs in the errors of failed range requests
tristan-deep Nov 4, 2026
0a2ba87
Draw no progress bar for reads below MIN_BYTES
tristan-deep Nov 4, 2026
68c62c7
Check the chunk cache with a stat in pending_bytes
tristan-deep Nov 4, 2026
7b3d0ec
Fetch the blocks of a small read concurrently
tristan-deep Nov 4, 2026
3f43635
Merge ranges only while a request downloads no more gap bytes than ch…
tristan-deep Nov 4, 2026
afcc0ef
Keep one block cache per streamed file instead of two
tristan-deep Nov 4, 2026
dca16d0
Ask the stream whether it keeps the blocks it reads
tristan-deep Nov 4, 2026
dcd792d
Share the on-disk cache helpers of the Hub listing and the CDN URLs
tristan-deep Nov 4, 2026
3fcd16b
Merge branch 'main' into feature/hf-cdn-streaming
tristan-deep Nov 4, 2026
08f275f
Merge branch 'main' into feature/hf-cdn-streaming
swpenninga Nov 4, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Draw no progress bar for reads below MIN_BYTES
Small reads now take the fast path, and their chunks are cached as whole blocks, so
pending_bytes never found them and every small read drew a 'streaming' bar, even one
served from the cache. A read below MIN_BYTES is one request at most; it gets no bar, as
when h5py served it. A progress callback still gets every tick.
  • Loading branch information
tristan-deep committed Nov 4, 2026
commit 0a2ba874e6614e9c82e1daaf1784870965f2f2c8
13 changes: 13 additions & 0 deletions tests/data/test_hf_remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,3 +330,16 @@ def test_no_prefetch_when_nothing_keeps_the_block(small_cdn, monkeypatch):
with File(HF_PATH, progress=False, cache=False) as remote:
remote[RAW].shape
assert calls == [(0, 1)]


def test_small_reads_draw_no_progress_bar(small_cdn, monkeypatch):
"""A read below MIN_BYTES is one request at most, so it gets no bar (h5py, which served
these reads before, drew none either)."""
from unittest.mock import MagicMock

tqdm_mock = MagicMock()
monkeypatch.setattr("tqdm.auto.tqdm", tqdm_mock)
with File(HF_PATH, progress=False) as remote:
for _ in range(2):
chunk_reader.read(remote[RAW], 0, remote._chunk_fetcher, progress=True)
tqdm_mock.assert_not_called()
2 changes: 2 additions & 0 deletions zea/data/chunk_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -996,6 +996,8 @@ def fetch_and_place(task, on_bytes):
# total before a single byte moves — it measures the bytes actually transferred, not a
# guess. Ticks arrive from worker threads; tqdm.update is thread-safe.
total = sum(int(task[0].size) for task in tasks)
if small and not callable(progress):
progress = False # one quick request at most: a bar would only flash by
all_ranges = [(int(task[0].byte_offset), int(task[0].size)) for task in tasks]
with _ticker(progress, total, all_ranges, fetcher) as on_bytes:
with ThreadPoolExecutor(max_workers=MAX_WORKERS) as pool:
Expand Down