Skip to content

Commit 1d1e6a9

Browse files
authored
server : (webui) allow typing and submitting during llm response (#11626)
1 parent 5598f47 commit 1d1e6a9

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

examples/server/public/index.html.gz

46 Bytes
Binary file not shown.

examples/server/webui/index.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,6 @@ <h2 class="font-bold ml-4">Conversations</h2>
154154
placeholder="Type a message (Shift+Enter to add a new line)"
155155
v-model="inputMsg"
156156
@keydown.enter.exact.prevent="sendMessage"
157-
:disabled="isGenerating"
158157
id="msg-input"
159158
dir="auto"
160159
></textarea>

examples/server/webui/src/main.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -469,6 +469,14 @@ const mainApp = createApp({
469469
},
470470
async sendMessage() {
471471
if (!this.inputMsg) return;
472+
473+
if (this.isGenerating) {
474+
this.stopGeneration();
475+
while (this.isGenerating) {
476+
await new Promise((resolve) => setTimeout(resolve, 10));
477+
}
478+
}
479+
472480
const currConvId = this.viewingConvId;
473481

474482
StorageUtils.appendMsg(currConvId, {

0 commit comments

Comments
 (0)