FastChat icon indicating copy to clipboard operation
FastChat copied to clipboard

How can I enter new line on CLI

Open hellocomrade opened this issue 1 year ago • 6 comments

I'd like ask questions with multiple paragraphs. According to the model itself:

USER: how can I type new line here?
ASSISTANT: To create a new line in this text input, you can press the `Enter` key on your keyboard. This will create a line break and move to the next line. Alternatively, you can use the `Shift + Enter` key combination to create a line break without moving the cursor to the next line.
USER:
exit...

But if I hit Enter, the script exits...

Please advise.

hellocomrade avatar Apr 20 '23 21:04 hellocomrade

Unfortunately, I don't think the CLI supports it currently, but a workaround is typing the message in a basic text editor and then copying and pasting into the terminal.

laidybug avatar Apr 20 '23 21:04 laidybug

@suquark seems like a bug on the CLI? It currently uses enter as an exit signal

zhisbug avatar Apr 20 '23 23:04 zhisbug

Oh, I just follows the original CLI behavior, where enter in the empty line exits the console. This indeed sounds not user friendly. I'll improve it.

Also the suggestion from the bot would only work on a website, as most console does realize shift in shift+enter; but our model (or other models) clearly cannot know it is running in a console w/o being told so. So I think this is a UI issue, not a bug.

suquark avatar Apr 20 '23 23:04 suquark

Has this issue been fixed? If we want to chat for multiple rounds, which command to use to avoid this UI issue?

wangrui6 avatar May 22 '23 16:05 wangrui6

@suquark What are the issues with multiline input?

https://github.com/lm-sys/FastChat/blob/51ed4fab89f61988e8395a3268595f1effb8528f/fastchat/serve/cli.py#L55-L61

It works fine on Linux, I just changed multiline to True and use ESC + Enter to submit.

Edit: thought I should mention, when using rich style output.

Steve-Tech avatar May 26 '23 10:05 Steve-Tech

ping @suquark

merrymercy avatar Jun 14 '23 07:06 merrymercy