[][src]Struct tokenizers::models::bpe::BPE

pub struct BPE { /* fields omitted */ }

Methods

impl BPE[src]

pub fn builder() -> BpeBuilder[src]

Initialize a BpeBuilder.

pub fn new(
    vocab: HashMap<String, u32>,
    merges: HashMap<(u32, u32), (u32, u32)>
) -> Self
[src]

Create a new BPE model with the given vocab and merges.

pub fn from_files(vocab: &str, merges: &str) -> BpeBuilder[src]

Initialize a BpeBuilder model from vocab and merges files

pub fn read_files(
    vocab: &str,
    merges: &str
) -> Result<(HashMap<String, u32>, HashMap<(u32, u32), (u32, u32)>)>
[src]

Read the given files to extract the vocab and merges

pub fn clear_cache(&self)[src]

Reset the cache.

pub fn get_vocab(&self) -> &HashMap<String, u32>[src]

pub fn get_unk_token(&self) -> &Option<String>[src]

pub fn get_continuing_subword_prefix(&self) -> &Option<String>[src]

Trait Implementations

impl Clone for BPE[src]

impl Default for BPE[src]

impl Model for BPE[src]

Auto Trait Implementations

impl RefUnwindSafe for BPE

impl Send for BPE

impl Sync for BPE

impl Unpin for BPE

impl UnwindSafe for BPE

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,