Skip to main content

parse_jsonl_bytes

Function parse_jsonl_bytes 

Source
pub fn parse_jsonl_bytes(
    bytes: &[u8],
    split: &str,
) -> Result<Vec<LabeledExample>, ContrastiveDataError>
Expand description

Parse a JSONL buffer into typed rows, preserving input order.

split names the role for error messages only; it is not compared against the rows’ embedded source_split here. That comparison is the split constructor’s Gate 2, because only the constructor knows which role is being built.

§Errors

ContrastiveDataError::InvalidUtf8, ContrastiveDataError::MalformedRow, or ContrastiveDataError::EmptyInput, each naming the split and the zero-based row index.