llama.cpp icon indicating copy to clipboard operation
llama.cpp copied to clipboard

Input Chinese Its talk with itself

Open huanxiang666 opened this issue 2 years ago • 10 comments

image When I use Chinese Its will talk with itself

huanxiang666 avatar Apr 08 '23 04:04 huanxiang666

你好 means Hello in English It will output another message

huanxiang666 avatar Apr 08 '23 04:04 huanxiang666

To fix this, there should be an option to choose a text that must be added at the end of the user input. In this cause we should append \n### Assistant: so that the context is ready for a reply, this would also fix the chat escape that sometimes happens.

However nobody mentioned this in the past so i don't know if it will be added as a feature.

Belluxx avatar Apr 08 '23 09:04 Belluxx

@Belluxx 's answer is correct.

Here is my setup. In my initial prompt, I ask the bot to enter a new line and print "### Human:" after the response. In the interactive mode, I normally manually input "\ <new_line> ### Assistant:" to the end so the assistant could take over the control.

For a chatgpt-like experience:

./prompts/chatgpt.txt:

### Human: Let's start a chat between a curious human and an artificial intelligence assistant.
The assistant gives helpful, detailed, and polite answers to the human's questions.
The response should be concise and should focus on the topic human bring up. Don't include other topics.
After the response, the assistant should create a new line and print "### Human:" to pass the control to human.
### Assitant: Sure, I'm ready to assist you with any questions or topics you have in mind.
### Human:

command

./main -m <model_path> -t 6 -c 2048 -n 2048 --color -i -n -1 --reverse-prompt '### Human:' -f prompts/chatgpt.txt

yjlcoder avatar Apr 08 '23 16:04 yjlcoder

image

huanxiang666 avatar Apr 10 '23 00:04 huanxiang666

But I use Chinese ,\n###
Its still talk with itself You can try send “你好”

huanxiang666 avatar Apr 10 '23 01:04 huanxiang666

image

huanxiang666 avatar Apr 10 '23 01:04 huanxiang666

Try to write the chinese prompt, then before pressing "enter" append a \. Then press enter and then add ### Assistant: and press enter again

Belluxx avatar Apr 10 '23 01:04 Belluxx

I suggest you start the conversation with something like informative question or practical instruction. If you are using original LLama, you should know it's not fine-tuned for ChatGPT-like question-and-answer style conversations but for simply completing the text based on the context.

There are fine-tuned models such as Alpaca or Vicuna (the model I use in the screenshot). Note that the outcome of Chinese conversations is still weaker / less ideal compared to English ones. For Chinese specific model, you can start by looking into Chinese-LLaAMA-Alpaca or ChatGLM-6B.

Btw, "\n" stands for a new line, not meaning you need to manually type "\n" in the console.

Screenshot from 2023-04-09 19-36-59

yjlcoder avatar Apr 10 '23 01:04 yjlcoder

Adapt prompt itself, translate it to CN and try again.

ivanstepanovftw avatar Apr 10 '23 10:04 ivanstepanovftw

This is likely a special case of https://github.com/ggerganov/llama.cpp/issues/667

patrakov avatar Apr 10 '23 17:04 patrakov

This issue was closed because it has been inactive for 14 days since being marked as stale.

github-actions[bot] avatar Apr 11 '24 01:04 github-actions[bot]