Skip to content

WIP: testing only#2047

Draft
assafvayner wants to merge 13 commits into
mainfrom
assaf/test-hf-hub-1.0.0-rc.0
Draft

WIP: testing only#2047
assafvayner wants to merge 13 commits into
mainfrom
assaf/test-hf-hub-1.0.0-rc.0

Conversation

@assafvayner
Copy link
Copy Markdown

Summary

  • Bumps hf-hub Rust dependency to 1.0.0-rc.0 (was 0.4.1).
  • Migrates tokenizers/src/utils/from_pretrained.rs to the new HFClient / HFRepository builder-pattern API: split owner/name, download_file().filename(...).revision(...).send(), user_agent HashMap formatted as key/value; ....
  • Switches the optional crate feature from ureq to blocking (the new sync-API gate). The rustls-tls feature in tokenizers is preserved as a no-op since hf-hub 1.0 no longer exposes a TLS-backend toggle (reqwest's default TLS is used).

Test plan

  • cargo check --features http (passes locally)
  • cargo check --features "http rustls-tls" (passes locally)
  • cargo clippy --features http -- -D warnings (passes locally)
  • Run cargo test --features http --test from_pretrained against the network to confirm the new API still resolves tokenizer.json for bert-base-cased, anthony/tokenizers-test, and revision overrides.

WIP: testing only.

Migrates `from_pretrained` to the new `HFClient` / `HFRepository` API
(builder-pattern download, owner/name split, `blocking` feature).
The `rustls-tls` cargo feature is preserved as a no-op since hf-hub
1.0 no longer exposes a TLS-backend toggle.
@HuggingFaceDocBuilderDev
Copy link
Copy Markdown

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

Without this, edition 2018 + no explicit `resolver` defaults to v1.
v1 unifies feature activations globally across the resolve graph,
including those introduced by `[target.'cfg(...)'.dependencies]`
blocks for targets that aren't active. xet-data (transitive via
hf-hub -> hf-xet) gates `sha2/asm` to non-Windows targets, but v1
leaks the activation onto Windows anyway and pulls in `sha2-asm`,
which doesn't compile on `windows-msvc`.

Resolver v2 respects the target gate. Verified with
`cargo tree --target x86_64-pc-windows-msvc` — `sha2-asm` is no
longer in the resolve. Python and Node bindings already use
edition 2021 (default v2), so they're unaffected.
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.

2 participants