pub struct ChatMlPrompt;Expand description
The generic ChatML fallback prompt for a model with no chat template.
Implementations§
Source§impl ChatMlPrompt
impl ChatMlPrompt
Sourcepub const NO_TEMPLATE_NOTICE: &'static str = "this model has no chat template — using a generic format"
pub const NO_TEMPLATE_NOTICE: &'static str = "this model has no chat template — using a generic format"
Shown when a model declares no chat template and this format is used.
Sourcepub fn render(messages: &[ChatMessage]) -> String
pub fn render(messages: &[ChatMessage]) -> String
Render messages as a ChatML prompt ending with an open assistant turn.
Auto Trait Implementations§
impl Freeze for ChatMlPrompt
impl RefUnwindSafe for ChatMlPrompt
impl Send for ChatMlPrompt
impl Sync for ChatMlPrompt
impl Unpin for ChatMlPrompt
impl UnsafeUnpin for ChatMlPrompt
impl UnwindSafe for ChatMlPrompt
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