text-generation-webui icon indicating copy to clipboard operation
text-generation-webui copied to clipboard

Render the output without refocusing the cursor on the screen

Open srevenant opened this issue 1 year ago • 3 comments

Description

The UI constantly re-focuses the cursor during rendering, so it is impossible to copy results while they are being rendered. Compare this to ChatGPT where you can copy text during rendering. For long or slow output, this is really relevant.

I don't know anything about the framework in use w/Python, or I'd try to dive in and fix it.

srevenant avatar Jul 25 '24 22:07 srevenant

I agree that this is not ideal. It happens because the entire chat HTML is updated for each new token and passed as input to a gr.HTML element, namely:

https://github.com/oobabooga/text-generation-webui/blob/498fec2c7c7df376007f264261acfcfcb76168ea/modules/ui_chat.py#L26

If you can think of a simple way to improve this a PR would be welcome.

oobabooga avatar Jul 25 '24 22:07 oobabooga

hmm. have you thought about a different frontend framework? React w/API is powerful, that's where I usually end up.

srevenant avatar Jul 25 '24 22:07 srevenant

@srevenant Might be something the gradio people are interested in supporting upstream if you raise a relevant feature request there?

jjlee avatar Aug 08 '24 21:08 jjlee