From 9a0a110b71033bbe8d2ad7b58edd745d49edae22 Mon Sep 17 00:00:00 2001 From: Seonglae Cho Date: Tue, 3 Dec 2024 08:22:26 +0900 Subject: [PATCH] fix: streaming example from @xenova's suggestion Co-authored-by: Joshua Lochner --- docs/source/pipelines.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/source/pipelines.md b/docs/source/pipelines.md index bec5abadb..7ee32ddff 100644 --- a/docs/source/pipelines.md +++ b/docs/source/pipelines.md @@ -171,7 +171,8 @@ const messages = [ // Create text streamer const streamer = new TextStreamer(generator.tokenizer, { skip_prompt: true, - callback_function: (text) => process.stdout.write(text), // Stream to command line + // Optionally, do something with the text (e.g., write to a textbox) + // callback_function: (text) => { /* Do something with text */ }, }) // Generate a response