Skip to content

Commit

Permalink
[Example] increase the output size from 1000 to 4096*6 (#44)
Browse files Browse the repository at this point in the history
  • Loading branch information
hydai authored Oct 3, 2023
1 parent 0c95897 commit 316f02d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions wasmedge-ggml-llama-interactive/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,10 @@ fn main() {
context.compute().unwrap();

// Retrieve the output.
let mut output_buffer = vec![0u8; 1000];
let output_size = context.get_output(0, &mut output_buffer).unwrap();
let max_output_size = 4096*6;
let mut output_buffer = vec![0u8; max_output_size];
let mut output_size = context.get_output(0, &mut output_buffer).unwrap();
output_size = std::cmp::min(max_output_size, output_size);
let output = String::from_utf8_lossy(&output_buffer[..output_size]).to_string();
println!("Answer:\n{}", output.trim());

Expand Down
Binary file not shown.

0 comments on commit 316f02d

Please sign in to comment.