Skip to content

Commit 316f02d

Browse files
authored
[Example] increase the output size from 1000 to 4096*6 (second-state#44)
1 parent 0c95897 commit 316f02d

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

‎wasmedge-ggml-llama-interactive/src/main.rs‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,10 @@ fn main() {
5454
context.compute().unwrap();
5555

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

Binary file not shown.

0 commit comments

Comments
 (0)