Skip to content

Commit

Permalink
Chat now takes into account the context
Browse files Browse the repository at this point in the history
  • Loading branch information
tachyonicbytes committed Jan 16, 2024
1 parent e3960ab commit 1e1b8b0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion examples/tauri-postgres/src-tauri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,9 @@ async fn start_chat(

let model = "llama2:latest".to_string();

let generation_request = GenerationRequest::new(model, question.to_string());
let prompt = format!("{} Answer based on this context: {}", question, context);

let generation_request = GenerationRequest::new(model, prompt);
let mut stream = llama2.generate_stream(generation_request).await.unwrap();
while let Some(result) = stream.next().await {
let async_proc_input_tx = state.inner.lock().await;
Expand Down

0 comments on commit 1e1b8b0

Please sign in to comment.