Skip to content

Commit

Permalink
Merge pull request #39 from milosgajdos/update-readme
Browse files Browse the repository at this point in the history
update: update README streaming example
  • Loading branch information
pepperoni21 authored Apr 9, 2024
2 parents 2876a80 + 5758d30 commit a23110e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,11 @@ let mut stream = ollama.generate_stream(GenerationRequest::new(model, prompt)).a

let mut stdout = tokio::io::stdout();
while let Some(res) = stream.next().await {
let res = res.unwrap();
stdout.write(res.response.as_bytes()).await.unwrap();
stdout.flush().await.unwrap();
let responses = res.unwrap();
for resp in responses {
stdout.write(resp.response.as_bytes()).await.unwrap();
stdout.flush().await.unwrap();
}
}
```

Expand Down

0 comments on commit a23110e

Please sign in to comment.