Skip to content

Commit

Permalink
added 2 more warning logs
Browse files Browse the repository at this point in the history
  • Loading branch information
andthattoo committed Sep 3, 2024
1 parent ba038f7 commit 91f3086
Show file tree
Hide file tree
Showing 3 changed files with 122 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/program/executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,14 @@ impl Executor {
}
num_steps += 1;
}
// log if elapsed time is bigger the max time
if start.elapsed().as_secs() >= max_time {
warn!("Max time exceeded, halting");
}
// log if max steps is reached
if num_steps >= max_steps {
warn!("Max steps reached, halting");
}
let rv = workflow.get_return_value();
let return_value = self.handle_input(&rv.input, memory).await;
let mut return_string = return_value.to_string().clone();
Expand Down
16 changes: 16 additions & 0 deletions tests/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const TICKER_WORKFLOW_PATH: &str = "./tests/test_workflows/ticker.json";
const SIMPLE_WORKFLOW_PATH: &str = "./tests/test_workflows/simple.json";
const INSERT_WORKFLOW_PATH: &str = "./tests/test_workflows/insert.json";
const USERS_WORKFLOW_PATH: &str = "./tests/test_workflows/users.json";
const CONTEXT_SIZE_WORKFLOW_PATH: &str = "./tests/test_workflows/context_size.json";

async fn setup_test(model: Model) -> Executor {
dotenv().ok();
Expand Down Expand Up @@ -143,3 +144,18 @@ mod post_process_workflow_tests {
"Summarize the main plot points of Romeo and Juliet."
);
}

mod context_size_tests {
use super::*;

workflow_test!(
context_size_phi3_5,
Model::Phi3_5Mini,
CONTEXT_SIZE_WORKFLOW_PATH
);
workflow_test!(
context_size_llama,
Model::Llama3_1_8B,
CONTEXT_SIZE_WORKFLOW_PATH
);
}
98 changes: 98 additions & 0 deletions tests/test_workflows/context_size.json

Large diffs are not rendered by default.

0 comments on commit 91f3086

Please sign in to comment.