Skip to content

Commit

Permalink
Fix decoder issue in streaming response
Browse files Browse the repository at this point in the history
  • Loading branch information
ariya committed Aug 20, 2024
1 parent 4ec4084 commit d2623d8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ask-llm.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ const chat = async (messages, handler) => {
break;
}
if (line.length > 0) {
const partial = parse(line);
const partial = parse(line.trim());
if (partial === null) {
buffer = line;
} else if (partial && partial.length > 0) {
Expand Down
2 changes: 1 addition & 1 deletion ask-llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def parse(line):
finished = True
break
elif line:
partial = parse(line)
partial = parse(line.strip())
if partial is not None:
if len(full_answer) == 0:
full_answer = partial.strip()
Expand Down

0 comments on commit d2623d8

Please sign in to comment.