Skip to content

Commit

Permalink
[Example] ggml: fix error about empty stream-stdout
Browse files Browse the repository at this point in the history
Signed-off-by: dm4 <[email protected]>
  • Loading branch information
dm4 authored and hydai committed Jan 23, 2024
1 parent 0b2d05c commit a5bc02c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions wasmedge-ggml-llama-interactive/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -297,11 +297,12 @@ fn main() {
// Retrieve the output.
output = get_output_from_context(&context, is_compute_single);

// Print the output if not streaming.
if !options["stream-stdout"].as_bool().unwrap() {
print!("{}", output.trim());
// Skip the output if is streaming.
if let Some(true) = options["stream-stdout"].as_bool() {
println!("");
} else {
println!("{}", output.trim());
}
println!("");
}

// Update the saved prompt.
Expand Down
Binary file not shown.

0 comments on commit a5bc02c

Please sign in to comment.