[][src]Struct sbert::sbert::SafeSBert

pub struct SafeSBert<T: Tokenizer> {
    pub sbert: SBert<T>,
    pub tokenizer: T,
    // some fields omitted
}

Fields

sbert: SBert<T>tokenizer: T

Implementations

impl<T: Tokenizer> SafeSBert<T>[src]

pub fn new<P: Into<PathBuf>>(root: P) -> Result<Self, Error>[src]

pub fn tokenize_batch<S: AsRef<str>>(
    &self,
    sorted_pad_input: &[S]
) -> (SafeTensor, SafeTensor)
[src]

pub fn forward_batch(
    &self,
    batch_attention: SafeTensor,
    batch_tensor: SafeTensor
) -> Tensor
[src]

pub fn encode<S: AsRef<str>, B: Into<Option<usize>>>(
    &self,
    input: &[S],
    batch_size: B
) -> Result<Vec<Embeddings>, Error>
[src]

pub fn par_encode<S: AsRef<str> + Send + Sync, B: Into<Option<usize>>>(
    &self,
    input: &[S],
    batch_size: B
) -> Result<Vec<Embeddings>, Error>
[src]

Trait Implementations

impl<T: Tokenizer> Send for SafeSBert<T>[src]

impl<T: Tokenizer> Sync for SafeSBert<T>[src]

Auto Trait Implementations

impl<T> !RefUnwindSafe for SafeSBert<T>

impl<T> Unpin for SafeSBert<T> where
    T: Unpin

impl<T> !UnwindSafe for SafeSBert<T>

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, 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>,