pub struct FramesLoader;Expand description
Loads FRAMES benchmark scenarios from a JSONL file.
Source: google/frames-benchmark
on HuggingFace.
Schema: one JSON object per line:
{"Prompt": "...", "Answer": "...", "reasoning_types": [...], "wiki_links": [...]}Each non-empty line becomes one Scenario:
id—"frames_{line_number}"(zero-based, counting from the first line of the file).prompt— value of"Prompt".expected— value of"Answer".metadata— value of"reasoning_types"(array of strings, ornull).
Empty lines are skipped. Unknown fields (e.g. "wiki_links") are ignored.
§Examples
use std::path::Path;
use zeph_bench::loaders::FramesLoader;
use zeph_bench::scenario::DatasetLoader;
let scenarios = FramesLoader.load(Path::new("/data/frames.jsonl")).unwrap();
println!("loaded {} scenarios", scenarios.len());Trait Implementations§
Source§impl DatasetLoader for FramesLoader
impl DatasetLoader for FramesLoader
Source§fn load(&self, path: &Path) -> Result<Vec<Scenario>, BenchError>
fn load(&self, path: &Path) -> Result<Vec<Scenario>, BenchError>
§Errors
Returns BenchError::Io when the file cannot be read and
BenchError::InvalidFormat when a JSONL line cannot be parsed.
Source§fn name(&self) -> &'static str
fn name(&self) -> &'static str
Short identifier matching the dataset name in
crate::DatasetRegistry.Auto Trait Implementations§
impl Freeze for FramesLoader
impl RefUnwindSafe for FramesLoader
impl Send for FramesLoader
impl Sync for FramesLoader
impl Unpin for FramesLoader
impl UnsafeUnpin for FramesLoader
impl UnwindSafe for FramesLoader
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request