Skip to content

Commit

Permalink
events
Browse files Browse the repository at this point in the history
  • Loading branch information
aj-ya committed Sep 29, 2023
1 parent 316be44 commit fb82242
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/utils/inference/vllm-stream.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,13 +122,13 @@ export const streamOpenAIInferenceServer = async (
onmessage(msg) {
// if the server emits an error message, throw an exception
// so it gets handled by the onerror callback below:
if (msg.event === 'data') {
// const chunk = JSON.parse(msg.data) as VLLMOpenAICompletionsOutputType;
finalResponse += msg.data;
handleNewChunk(msg.data);
} else if (msg.event === 'error') {
console.error('error while streaming', msg.data);
}
// if (msg.event === 'data') {
// const chunk = JSON.parse(msg.data) as VLLMOpenAICompletionsOutputType;
finalResponse += msg.data;
handleNewChunk(msg.data);
// } else if (msg.event === 'error') {
// console.error('error while streaming', msg.data);
// }
},
// onclose() {
// // if the server closes the connection unexpectedly, retry:
Expand Down

0 comments on commit fb82242

Please sign in to comment.