Skip to content

Commit

Permalink
stop llama executor blocking
Browse files Browse the repository at this point in the history
  • Loading branch information
andychenbruce committed Aug 14, 2023
1 parent 5feb9bc commit d2beece
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions crates/llm-chain-llama/src/executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,8 @@ impl Executor {
let context_size = context_params.n_ctx as usize;
let answer_prefix = self.answer_prefix(&input.prompt);
tokio::task::spawn_blocking(move || {
async move {
let context_size = context_size;
let context = context.lock().await;
let context = context.blocking_lock();
let tokenized_stop_prompt = tokenize(
&context,
input
Expand Down Expand Up @@ -189,11 +188,7 @@ impl Executor {
{
panic!("Failed to send");
}
}
})
.await
.unwrap()
.await;
});//JoinHandle is dropped? not sure how this works

output
}
Expand Down

0 comments on commit d2beece

Please sign in to comment.