diff --git a/wasmedge-ggml-llama-interactive/src/main.rs b/wasmedge-ggml-llama-interactive/src/main.rs index a19e595..a64c4da 100644 --- a/wasmedge-ggml-llama-interactive/src/main.rs +++ b/wasmedge-ggml-llama-interactive/src/main.rs @@ -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()); diff --git a/wasmedge-ggml-llama-interactive/wasmedge-ggml-llama-interactive.wasm b/wasmedge-ggml-llama-interactive/wasmedge-ggml-llama-interactive.wasm index 2e9d33c..d928536 100755 Binary files a/wasmedge-ggml-llama-interactive/wasmedge-ggml-llama-interactive.wasm and b/wasmedge-ggml-llama-interactive/wasmedge-ggml-llama-interactive.wasm differ