Skip to content

Commit 653daf0

Browse files
dm4hydai
authored andcommitted
[Example] ggml: fix output print twice in basic example
Signed-off-by: dm4 <dm4@secondstate.io>
1 parent 06e3cb8 commit 653daf0

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

‎wasmedge-ggml/basic/src/main.rs‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,11 @@ fn main() {
115115
println!("Response:");
116116
context.compute().expect("Failed to compute");
117117
let output = get_output_from_context(&context);
118-
println!("{}", output.trim());
118+
if let Some(true) = options["stream-stdout"].as_bool() {
119+
println!();
120+
} else {
121+
println!("{}", output.trim());
122+
}
119123
std::process::exit(0);
120124
}
121125

120 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)