mirror of
https://github.com/ggml-org/llama.cpp.git
synced 2025-10-28 08:31:25 +00:00
server : (webui) allow typing and submitting during llm response (#11626)
This commit is contained in:
Binary file not shown.
@@ -154,7 +154,6 @@
|
|||||||
placeholder="Type a message (Shift+Enter to add a new line)"
|
placeholder="Type a message (Shift+Enter to add a new line)"
|
||||||
v-model="inputMsg"
|
v-model="inputMsg"
|
||||||
@keydown.enter.exact.prevent="sendMessage"
|
@keydown.enter.exact.prevent="sendMessage"
|
||||||
:disabled="isGenerating"
|
|
||||||
id="msg-input"
|
id="msg-input"
|
||||||
dir="auto"
|
dir="auto"
|
||||||
></textarea>
|
></textarea>
|
||||||
|
|||||||
@@ -469,6 +469,14 @@ const mainApp = createApp({
|
|||||||
},
|
},
|
||||||
async sendMessage() {
|
async sendMessage() {
|
||||||
if (!this.inputMsg) return;
|
if (!this.inputMsg) return;
|
||||||
|
|
||||||
|
if (this.isGenerating) {
|
||||||
|
this.stopGeneration();
|
||||||
|
while (this.isGenerating) {
|
||||||
|
await new Promise((resolve) => setTimeout(resolve, 10));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const currConvId = this.viewingConvId;
|
const currConvId = this.viewingConvId;
|
||||||
|
|
||||||
StorageUtils.appendMsg(currConvId, {
|
StorageUtils.appendMsg(currConvId, {
|
||||||
|
|||||||
Reference in New Issue
Block a user