Skip to content

Commit

Permalink
fix: streaming example from @xenova's suggestion
Browse files Browse the repository at this point in the history
Co-authored-by: Joshua Lochner <[email protected]>
  • Loading branch information
seonglae and xenova authored Dec 2, 2024
1 parent e0773ec commit 9a0a110
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion docs/source/pipelines.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9a0a110

Please sign in to comment.