Skip to content

Commit

Permalink
fix unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
randommm committed Nov 11, 2023
1 parent e0626f1 commit a0af50e
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/routes/llm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -255,15 +255,20 @@ fn format_size(size_in_bytes: usize) -> String {
mod tests {
use super::ModelBuilder;

#[tokio::test]
#[tokio::test(flavor = "multi_thread", worker_threads = 1)]
async fn sequential_dialog() {
let model = ModelBuilder::default().build().unwrap();
let prompt = "Create a basic Rust program".to_string();
let model = ModelBuilder {
sample_len: 30,
..Default::default()
}
.build()
.unwrap();
let prompt = "Create a Rust program in 20 words".to_string();
let pre_prompt_tokens = vec![];
let (output, pre_prompt_tokens) = model.interact(prompt, &pre_prompt_tokens).await.unwrap();
println!("{output}");

let prompt = "Give me the Cargo.toml".to_string();
let prompt = "Give me the Cargo.toml in 20 words".to_string();
let (output, _) = model.interact(prompt, &pre_prompt_tokens).await.unwrap();
println!("{output}");
}
Expand Down

0 comments on commit a0af50e

Please sign in to comment.