ep: Don't fail on lines with inference errors (#47406)
Release Notes: - N/A
This commit is contained in:
1 parent
0674d812b9
commit
a9ddc41f62
2 files changed
+13
No files matched your search
@@ -75,10 +75,21 @@ pub struct ExamplePrompt {
|
||||
pub struct ExamplePrediction {
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub actual_patch: Option<String>,
|
||||
#[serde(deserialize_with = "deserialize_null_as_empty_string")]
|
||||
pub actual_output: String,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub error: Option<String>,
|
||||
pub provider: PredictionProvider,
|
||||
}
|
||||
|
||||
fn deserialize_null_as_empty_string<'de, D>(deserializer: D) -> Result<String, D::Error>
|
||||
where
|
||||
D: serde::Deserializer<'de>,
|
||||
{
|
||||
let opt = Option::<String>::deserialize(deserializer)?;
|
||||
Ok(opt.unwrap_or_default())
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize)]
|
||||
pub struct ExampleScore {
|
||||
pub delta_chr_f: f32,
|
||||
|
||||
@@ -197,6 +197,7 @@ pub async fn run_prediction(
|
||||
.push(ExamplePrediction {
|
||||
actual_patch: None,
|
||||
actual_output: String::new(),
|
||||
error: None,
|
||||
provider,
|
||||
});
|
||||
|
||||
@@ -302,6 +303,7 @@ async fn predict_anthropic(
|
||||
let prediction = ExamplePrediction {
|
||||
actual_patch: Some(actual_patch),
|
||||
actual_output,
|
||||
error: None,
|
||||
provider: if batched {
|
||||
PredictionProvider::Teacher(version)
|
||||
} else {
|
||||
|
||||
Reference in new issue
Block a user