pub struct HarmonyEncoding { /* private fields */ }Implementations§
Source§impl HarmonyEncoding
impl HarmonyEncoding
pub fn name(&self) -> &str
pub fn tokenizer_name(&self) -> &str
pub fn max_message_tokens(&self) -> usize
pub fn tokenizer(&self) -> &CoreBPE
pub fn stop_tokens(&self) -> Result<HashSet<u32>>
pub fn stop_tokens_for_assistant_actions(&self) -> Result<HashSet<u32>>
pub fn render_conversation_into<'a, I, B>( &self, conversation: I, into: &mut B, config: Option<&RenderConversationConfig>, ) -> Result<()>
pub fn render_conversation_for_completion_into<'a, I, B>( &self, conversation: I, next_turn_role: Role, into: &mut B, config: Option<&RenderConversationConfig>, ) -> Result<()>
pub fn render_conversation_for_completion<'a, I>(
&self,
conversation: I,
next_turn_role: Role,
config: Option<&RenderConversationConfig>,
) -> Result<Vec<u32>>where
I: IntoIterator<Item = &'a Message>,
pub fn render_conversation_for_training<'a, I>(
&self,
conversation: I,
config: Option<&RenderConversationConfig>,
) -> Result<Vec<u32>>where
I: IntoIterator<Item = &'a Message>,
pub fn render_conversation<'a, I>(
&self,
conversation: I,
config: Option<&RenderConversationConfig>,
) -> Result<Vec<u32>>where
I: IntoIterator<Item = &'a Message>,
pub fn render( &self, message: &Message, render_options: Option<&RenderOptions>, ) -> Result<Vec<u32>>
pub fn render_into<B>( &self, message: &Message, into: &mut B, render_options: Option<&RenderOptions>, ) -> Result<()>
pub fn parse_messages_from_completion_tokens<I>(
&self,
tokens: I,
role: Option<Role>,
) -> Result<Vec<Message>>where
I: IntoIterator<Item = u32>,
Trait Implementations§
Source§impl Clone for HarmonyEncoding
impl Clone for HarmonyEncoding
Source§fn clone(&self) -> HarmonyEncoding
fn clone(&self) -> HarmonyEncoding
Returns a duplicate 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 HarmonyEncoding
impl Debug for HarmonyEncoding
Auto Trait Implementations§
impl Freeze for HarmonyEncoding
impl RefUnwindSafe for HarmonyEncoding
impl Send for HarmonyEncoding
impl Sync for HarmonyEncoding
impl Unpin for HarmonyEncoding
impl UnwindSafe for HarmonyEncoding
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.