Skip to content

Commit

Permalink
[Example] Add initial question for interactive example (#43)
Browse files Browse the repository at this point in the history
Signed-off-by: dm4 <[email protected]>
  • Loading branch information
dm4 authored Oct 3, 2023
1 parent 4f4ec01 commit 525ff8d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions wasmedge-ggml-llama-interactive/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ fn main() {
let system_prompt = String::from("<<SYS>>You are a helpful, respectful and honest assistant. Always answer as short as possible, while being safe. <</SYS>>");
let mut saved_prompt = String::new();

// Ask a quick question to load the model
let initial_prompt = "Are you ready to answer questions? Answer yes or no.";
context
.set_input(0, wasi_nn::TensorType::U8, &[1], &initial_prompt.as_bytes().to_vec())
.unwrap();
context.compute().unwrap();

loop {
println!("Question:");
let input = read_input();
Expand Down

0 comments on commit 525ff8d

Please sign in to comment.