Skip to content

Commit

Permalink
feat: stop continue regeneration
Browse files Browse the repository at this point in the history
  • Loading branch information
tjbck committed Feb 16, 2024
1 parent 30f0f34 commit 5bcbb78
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/lib/components/chat/Messages/ResponseMessage.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
await tick();
if (tooltipInstance) {
tooltipInstance[0].destroy();
tooltipInstance[0]?.destroy();
}
renderLatex();
Expand Down
3 changes: 3 additions & 0 deletions src/routes/(app)/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -709,6 +709,9 @@
if (messages.length != 0 && messages.at(-1).done == true) {
const responseMessage = history.messages[history.currentId];
responseMessage.done = false;
await tick();
const modelTag = $models.filter((m) => m.name === responseMessage.model).at(0);
if (modelTag?.external) {
Expand Down
5 changes: 4 additions & 1 deletion src/routes/(app)/c/[id]/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
} from '$lib/stores';
import { copyToClipboard, splitStream, convertMessagesToHistory } from '$lib/utils';
import { generateChatCompletion, generateTitle } from '$lib/apis/ollama';
import { generateChatCompletion, generateTitle, cancelChatCompletion } from '$lib/apis/ollama';
import {
addTagById,
createNewChat,
Expand Down Expand Up @@ -711,6 +711,9 @@
if (messages.length != 0 && messages.at(-1).done == true) {
const responseMessage = history.messages[history.currentId];
responseMessage.done = false;
await tick();
const modelTag = $models.filter((m) => m.name === responseMessage.model).at(0);
if (modelTag?.external) {
Expand Down

0 comments on commit 5bcbb78

Please sign in to comment.