Skip to content

[test-only] upstream mirror of #2268 — validate tokenizer fixes with HF_TOKEN#2269

Closed
bhimrazy wants to merge 8 commits into
mainfrom
fix/tokenizer-registry-fallback
Closed

[test-only] upstream mirror of #2268 — validate tokenizer fixes with HF_TOKEN#2269
bhimrazy wants to merge 8 commits into
mainfrom
fix/tokenizer-registry-fallback

Conversation

@bhimrazy

@bhimrazy bhimrazy commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator

What does this PR do?

Upstream mirror of #2268 to validate the tokenizer test fixes against CI with HF_TOKEN available. Not for merge — see #2268 for the actual change and discussion.

bhimrazy added 5 commits June 16, 2026 23:11
AutoTokenizer.from_pretrained raises a bare OSError for gated repos,
which _is_gated_hf_error doesn't recognise — causing the test to fail
and retry 3×120s per model (6 min each) until the 35-min job times out.

Switch to huggingface_hub.snapshot_download with allow_patterns limited
to tokenizer/config files (no weights, no safetensors). It raises the
typed GatedRepoError that the existing skip check already handles, so
fork PRs without HF_TOKEN skip cleanly in seconds. Using the default HF
cache (no local_dir) also means retries and CI caching reuse downloads.
pytest 9 removed the `path` argument from the pytest_collect_file
hookspec. pytest-check-links 0.9.1 still declares the old signature,
causing a PluginValidationError on startup. The uv migration (#2257)
un-pinned pytest, which let 9.x get resolved. Pin to <9 until
pytest-check-links ships a compatible release.
Fork PRs have no HF_TOKEN, so 6 parallel CI jobs hit HF anonymously and
get rate-limited (HTTP 429). The HfHubHTTPError wasn't caught, causing
each rate-limited model to fail and retry 3x120s until the job timed out.

Extend the skip check to include 429 and rename to _is_hf_skip_error to
reflect that it now covers both gated repos and anonymous rate-limits.
@bhimrazy bhimrazy changed the title test changes test changes for upstream from #2268 Jun 18, 2026
bhimrazy added 3 commits June 23, 2026 11:23
snapshot_download returns a commit-hash path; litgpt's Tokenizer infers
BOS from the directory name (SmolLM2-*-Instruct, Llama-3*, etc.) so
symlink the cached files into tmp_path/<model-name> to preserve that.

Also temporarily scope pytester to test_tokenizer.py for faster CI
iteration while this is being validated.
CI sets a relative HF_HOME (.cache-HF), so snapshot_download returns a
relative path; symlinking from the test's tmp_path produced dangling
links and every tokenizer test failed. Copy the small tokenizer/config
files into the model-named dir instead — robust regardless of HF_HOME.
Drop the check-links and cpu-tests.yml edits (check-links fix lives in a
separate PR; restore the full CPU test suite) and trim the tokenizer test
comments to the essentials.
@bhimrazy bhimrazy changed the title test changes for upstream from #2268 [test-only] upstream mirror of #2268 — validate tokenizer fixes with HF_TOKEN Jun 23, 2026
@bhimrazy bhimrazy closed this Jun 24, 2026
@bhimrazy
bhimrazy deleted the fix/tokenizer-registry-fallback branch June 24, 2026 00:48
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.

1 participant