Skip to content

Commit

Permalink
Close queue when end of stream is reached.
Browse files Browse the repository at this point in the history
  • Loading branch information
lgrammel committed Jul 11, 2023
1 parent 75aa96c commit 8829757
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/model-provider/llamacpp/LlamaCppTextGenerationModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,10 @@ async function createLlamaCppFullDeltaIterableQueue(
delta: event.content,
},
});

if (event.stop) {
queue.close();
}
} catch (error) {
queue.push({ type: "error", error });
queue.close();
Expand Down

1 comment on commit 8829757

@vercel
Copy link

@vercel vercel bot commented on 8829757 Jul 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

ai-utils-js – ./

ai-utils-js-git-main-lgrammel.vercel.app
ai-utils.dev
ai-utils.vercel.app
ai-utils-js-lgrammel.vercel.app

Please sign in to comment.