pub struct TogetherFormat {
pub use_chat_format: bool,
}Expand description
Together AI fine-tuning format.
Uses OpenAI-compatible chat format but with text wrapper:
{"text": "<s>[INST] ... [/INST] ..."}
For chat format (preferred), same as OpenAI: {"messages": [...]}
Fields§
§use_chat_format: boolIf true, use chat messages format (OpenAI-compatible). If false, use text template.
Implementations§
Trait Implementations§
Source§impl Default for TogetherFormat
impl Default for TogetherFormat
Source§impl FormatConverter for TogetherFormat
impl FormatConverter for TogetherFormat
Source§fn to_json(&self, example: &TrainingExample) -> DatasetResult<Value>
fn to_json(&self, example: &TrainingExample) -> DatasetResult<Value>
Convert a TrainingExample to this format’s JSON representation.
Source§fn parse_json(&self, value: &Value) -> DatasetResult<TrainingExample>
fn parse_json(&self, value: &Value) -> DatasetResult<TrainingExample>
Parse this format’s JSON back into a TrainingExample.
Source§fn to_json_batch(
&self,
examples: &[TrainingExample],
) -> DatasetResult<Vec<Value>>
fn to_json_batch( &self, examples: &[TrainingExample], ) -> DatasetResult<Vec<Value>>
Convert a batch of examples to this format.
Source§fn parse_json_batch(
&self,
values: &[Value],
) -> DatasetResult<Vec<TrainingExample>>
fn parse_json_batch( &self, values: &[Value], ) -> DatasetResult<Vec<TrainingExample>>
Parse a batch of JSON values into training examples.
Source§impl PreferenceConverter for TogetherFormat
impl PreferenceConverter for TogetherFormat
Source§fn preference_to_json(&self, pair: &PreferencePair) -> DatasetResult<Value>
fn preference_to_json(&self, pair: &PreferencePair) -> DatasetResult<Value>
Convert a PreferencePair to this format’s JSON representation.
Source§fn parse_preference_json(&self, value: &Value) -> DatasetResult<PreferencePair>
fn parse_preference_json(&self, value: &Value) -> DatasetResult<PreferencePair>
Parse this format’s JSON back into a PreferencePair.
Source§fn preference_to_json_batch(
&self,
pairs: &[PreferencePair],
) -> DatasetResult<Vec<Value>>
fn preference_to_json_batch( &self, pairs: &[PreferencePair], ) -> DatasetResult<Vec<Value>>
Convert a batch of preference pairs to this format.
Source§fn parse_preference_json_batch(
&self,
values: &[Value],
) -> DatasetResult<Vec<PreferencePair>>
fn parse_preference_json_batch( &self, values: &[Value], ) -> DatasetResult<Vec<PreferencePair>>
Parse a batch of JSON values into preference pairs.
Auto Trait Implementations§
impl Freeze for TogetherFormat
impl RefUnwindSafe for TogetherFormat
impl Send for TogetherFormat
impl Sync for TogetherFormat
impl Unpin for TogetherFormat
impl UnsafeUnpin for TogetherFormat
impl UnwindSafe for TogetherFormat
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> 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