mirror of
https://github.com/zed-industries/zed.git
synced 2026-05-29 10:54:13 +00:00
This command takes raw LLM outputs (`predictions.actual_output`) that could be generated elsewhere and parses them into a canonical unified diff (`predictions.actual_patch`). This is useful for simplifying the evaluation pipeline and for rerunning the parser without having to generate LLM outputs. Release Notes: - N/A
17 lines
428 B
Rust
17 lines
428 B
Rust
use anyhow::Result;
|
|
use std::mem;
|
|
|
|
use crate::example::Example;
|
|
|
|
pub async fn run_distill(example: &mut Example) -> Result<()> {
|
|
let predictions = mem::take(&mut example.predictions)
|
|
.into_iter()
|
|
.filter_map(|p| p.actual_patch)
|
|
.collect();
|
|
|
|
example.spec.expected_patches = predictions;
|
|
example.prompt = None;
|
|
example.predictions = Vec::new();
|
|
example.score = Vec::new();
|
|
Ok(())
|
|
}
|