Allow re-running from examples with changed provider
This commit is contained in:
@@ -151,7 +151,7 @@ struct PredictArgs {
|
||||
repetitions: usize,
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug, ValueEnum, Serialize, Deserialize)]
|
||||
#[derive(Clone, Copy, Debug, PartialEq, ValueEnum, Serialize, Deserialize)]
|
||||
enum PredictionProvider {
|
||||
Sweep,
|
||||
Mercury,
|
||||
|
||||
@@ -28,12 +28,16 @@ pub async fn run_prediction(
|
||||
app_state: Arc<EpAppState>,
|
||||
mut cx: AsyncApp,
|
||||
) -> anyhow::Result<()> {
|
||||
if !example.predictions.is_empty() {
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
let provider = provider.context("provider is required")?;
|
||||
|
||||
if let Some(existing_prediction) = example.predictions.first() {
|
||||
if existing_prediction.provider == provider {
|
||||
return Ok(());
|
||||
} else {
|
||||
example.predictions.clear();
|
||||
}
|
||||
}
|
||||
|
||||
run_context_retrieval(example, app_state.clone(), cx.clone()).await?;
|
||||
|
||||
if matches!(
|
||||
|
||||
Reference in New Issue
Block a user