Skip to content

Commit c58a474

Browse files
authored
docs: add all features (#1953)
* docs: add http feature for docs and docsrs * add all features
1 parent 50352f7 commit c58a474

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

tokenizers/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ with a focus on performances and versatility.
1515
"""
1616
exclude = [ "rust-toolchain", "target/*", "Cargo.lock", "benches/*.txt", "benches/*.json", "data/*" ]
1717

18+
[package.metadata.docs.rs]
19+
all-features = true
20+
1821
[lib]
1922
name = "tokenizers"
2023
path = "src/lib.rs"

tokenizers/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#![cfg_attr(docsrs, feature(doc_cfg))]
12
#![warn(clippy::all)]
23
#![allow(clippy::upper_case_acronyms)]
34
#![doc(html_favicon_url = "https://huggingface.co/favicon.ico")]

tokenizers/src/tokenizer/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,7 @@ impl Tokenizer {
445445
Ok(tokenizer)
446446
}
447447
#[cfg(feature = "http")]
448+
#[cfg_attr(docsrs, doc(cfg(feature = "http")))]
448449
pub fn from_pretrained<S: AsRef<str>>(
449450
identifier: S,
450451
params: Option<crate::utils::from_pretrained::FromPretrainedParameters>,
@@ -1539,6 +1540,7 @@ where
15391540
note = "Users should download the file separately using https://github.com/huggingface/hf-hub instead, which splits concerns of accessing the web, and should use the new cache layout"
15401541
)]
15411542
#[cfg(feature = "http")]
1543+
#[cfg_attr(docsrs, doc(cfg(feature = "http")))]
15421544
/// Instantiate a new Tokenizer from a file hosted on the Hugging Face Hub.
15431545
/// It expects the `identifier` of a model that includes a `tokenizer.json` file.
15441546
pub fn from_pretrained<S: AsRef<str>>(

0 commit comments

Comments
 (0)