Enum llama_cpp_2::token_type::LlamaTokenType
source · #[repr(u32)]pub enum LlamaTokenType {
Undefined = 0,
Normal = 1,
Unknown = 2,
Control = 3,
UserDefined = 4,
Unused = 5,
Byte = 6,
}
Expand description
A rust flavored equivalent of llama_token_type
.
Variants§
Undefined = 0
An undefined token type.
Normal = 1
A normal token type.
Unknown = 2
An unknown token type.
Control = 3
A control token type.
UserDefined = 4
A user defined token type.
Unused = 5
An unused token type.
Byte = 6
A byte token type.
Trait Implementations§
source§impl Clone for LlamaTokenType
impl Clone for LlamaTokenType
source§fn clone(&self) -> LlamaTokenType
fn clone(&self) -> LlamaTokenType
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for LlamaTokenType
impl Debug for LlamaTokenType
source§impl PartialEq for LlamaTokenType
impl PartialEq for LlamaTokenType
source§fn eq(&self, other: &LlamaTokenType) -> bool
fn eq(&self, other: &LlamaTokenType) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl TryFrom<u32> for LlamaTokenType
impl TryFrom<u32> for LlamaTokenType
A safe wrapper for converting potentially deceptive llama_token_type
values into
LlamaVocabType
.
The error branch returns the original value.
let llama_token_type = LlamaTokenType::try_from(0 as c_uint)?;
assert_eq!(llama_token_type, LlamaTokenType::Undefined);
let bad_llama_token_type = LlamaTokenType::try_from(100 as c_uint);
assert_eq!(Err(LlamaTokenTypeFromIntError::UnknownValue(100)), bad_llama_token_type);
§type Error = LlamaTokenTypeFromIntError
type Error = LlamaTokenTypeFromIntError
The type returned in the event of a conversion error.
impl Copy for LlamaTokenType
impl Eq for LlamaTokenType
impl StructuralEq for LlamaTokenType
impl StructuralPartialEq for LlamaTokenType
Auto Trait Implementations§
impl RefUnwindSafe for LlamaTokenType
impl Send for LlamaTokenType
impl Sync for LlamaTokenType
impl Unpin for LlamaTokenType
impl UnwindSafe for LlamaTokenType
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