Skip to content

Feature Request: Web UI: Allow typing in textarea during generation #11565

@mashdragon

Description

@mashdragon

Prerequisites

  • I am running the latest code. Mention the version if possible as well.
  • I carefully followed the README.md.
  • I searched using keywords relevant to my issue to make sure that I am creating a new issue that is not already open (or closed).
  • I reviewed the Discussions, and have a new and useful enhancement to share.

Feature Description

Currently, the Llama.cpp web UI does not let you type at all in the chat textarea during generation, which the previous version of the web UI lets you do. This feature request is to allow users to type in the textbox again in the new UI.

When the model is generating, if you press enter, it should:

  1. Stop the model from generating
  2. Insert your new message at the end of the current conversation
  3. Start generation again

Motivation

When you are running large models that don't output quickly, it is nice to draft your response before the model is finished generating. Sometimes I think about my response while it's still going, and I don't want it to end early.

Anyway, this also was the prior behaviour, so it should be restored.

Possible Implementation

This at least stops the textarea from being disabled:

diff --git a/examples/server/webui/index.html b/examples/server/webui/index.html
index d3893ea4..17609820 100644
--- a/examples/server/webui/index.html
+++ b/examples/server/webui/index.html
@@ -153,9 +153,8 @@
             class="textarea textarea-bordered w-full"
             placeholder="Type a message (Shift+Enter to add a new line)"
             v-model="inputMsg"
-            @keydown.enter.exact.prevent="sendMessage"
+            @keydown.enter.exact.prevent="isGenerating && stopGeneration(); sendMessage()"
             @keydown.enter.shift.exact.prevent="inputMsg += '\n'"
-            :disabled="isGenerating"
             id="msg-input"
             dir="auto"
           ></textarea>

But if you press Enter during generation, it puts your message out of order and does not resume generation:

Image

(Nothing more is generated and it's the user's turn again according to the UI.)

So, I would like some help from someone familiar with the web UI.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions