Skip to content

Commit

Permalink
Synchronize README.md and src/lib.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
sondalex committed Jan 2, 2025
1 parent ad4d404 commit 4eee3f2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 2 additions & 0 deletions tokenizers/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,3 +137,5 @@ fn main() -> Result<()> {
**progressbar**: The progress bar visualization is enabled by default. It might be disabled if
compilation for certain targets is not supported by the [termios](https://crates.io/crates/termios)
dependency of the [indicatif](https://crates.io/crates/indicatif) progress bar.
**http**: This feature enables downloading the tokenizer via HTTP. It is disabled by default.
With this feature enabled, `Tokenizer::from_pretrained` becomes accessible.
7 changes: 4 additions & 3 deletions tokenizers/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,11 @@
//! fn main() -> Result<()> {
//! # #[cfg(feature = "http")]
//! # {
//! let tokenizer = Tokenizer::from_pretrained("bert-base-cased", None)?;
//! // needs http feature enabled
//! let tokenizer = Tokenizer::from_pretrained("bert-base-cased", None)?;
//!
//! let encoding = tokenizer.encode("Hey there!", false)?;
//! println!("{:?}", encoding.get_tokens());
//! let encoding = tokenizer.encode("Hey there!", false)?;
//! println!("{:?}", encoding.get_tokens());
//! # }
//! Ok(())
//! }
Expand Down

0 comments on commit 4eee3f2

Please sign in to comment.