pub struct RemoteTokenizer { /* private fields */ }Expand description
A tokenizer a head without the model takes from a node serving it: what it says without encoding is the node’s own, kept here, and text is encoded by a node serving the model, once per request rather than once per token. Text it encoded before is answered here: a conversation sends its system prompt and earlier turns again with every turn.
Implementations§
Source§impl RemoteTokenizer
impl RemoteTokenizer
pub fn new( fleet: Arc<FleetManager>, model: String, export: TokenizerExportMsg, ) -> RemoteTokenizer
Trait Implementations§
Source§impl Tokenizer for RemoteTokenizer
impl Tokenizer for RemoteTokenizer
fn encode(&self, text: &str) -> Vec<u32>
fn token_bytes(&self, token: u32) -> Vec<u8> ⓘ
fn vocab_size(&self) -> u32
fn special_tokens(&self) -> Vec<(String, u32)>
fn bos_token(&self) -> Option<u32>
fn eos_token(&self) -> u32
fn chat_template_jinja(&self) -> String
fn chat_template_named(&self, name: &str) -> Option<String>
fn encode_plain(&self, text: &str) -> Option<Vec<u32>>
fn encode_pieces(&self, pieces: &[(&str, bool)]) -> Option<Vec<u32>>
Auto Trait Implementations§
impl !Freeze for RemoteTokenizer
impl RefUnwindSafe for RemoteTokenizer
impl Send for RemoteTokenizer
impl Sync for RemoteTokenizer
impl Unpin for RemoteTokenizer
impl UnsafeUnpin for RemoteTokenizer
impl UnwindSafe for RemoteTokenizer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more