Skip to content

Commit

Permalink
fix: kanji issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Googlefan committed Jun 6, 2024
1 parent 1f0d7b9 commit beabfd7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/chat/llama.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,15 @@ async function* generate(chat: Chat[], system?: string) {
});
const stream = (await res.body.blob()).stream();
const reader = stream.getReader();
const dec = new TextDecoder();
while (true) {
const { done, value } = await reader.read();
if (done) {
break;
}
yield {
tokens: 1,
content: String.fromCharCode(...new Uint8Array(value)),
content: dec.decode(value),
};
}
}
Expand Down

0 comments on commit beabfd7

Please sign in to comment.