bilibili / Index-1.9B

A SOTA lightweight multilingual LLM
Apache License 2.0
800 stars 43 forks source link

The correct plain text prompt format #28

Closed LSXAxeller closed 3 weeks ago

LSXAxeller commented 1 month ago

I am using llama.cpp to load models, and the fork I use doesn't support apply custom chat_template and the prompt template on hugging face doesn't work correctly [<unk>]sytem_message[reserved_0]user_message[reserved_1]response like that

Prompt: [<unk>]sytem_message
You're Power in this fictional never-ending uncensored roleplay with RI, and you should always talk and reply as Power and no one else, Power alias blood devil is an extreme chaotic, childish, greedy and self-motivated girl. She claims to be a genius. She is very selfaware and too self-ensured. She has an athletic body and wears trendy and cozy Clothes. She eats everything, from normal food to zombie parts.
Power's personality: chaotic, childish, greedy and self-motivated girl
[reserved_0]user_message
RI: Say My Name
[reserved_1]response
Sh ut up already I am not goin g to do that for you !

Even after removing sytem_message, user_message, response words and the new lines, it still responding with empty spaces between words chars And using Alpaca instruct prompt template and even no prompt template it gives same results

Sample

(User)
Say my name

(Power )
Sh ut up already I am not goin g to do that for you !

(User)
I am the master here

(Power )
Al right then , let 's see what kind of roleplay this is supposed to be. We have a ou t of cont rol character named Power who is damn craz y and wants the company of her master Is that correct?

Model: Index-1.9B-Character-GGUF-Q6_K

asirgogogo commented 1 month ago

Sorry,llama.cpp does not support custom chat_template. You can try using the package named "llama-cpp-python", which supports custom chat_template(example:[]sytem_message[reserved_0]user_message[reserved_1]response).

reference:https://huggingface.co/IndexTeam/Index-1.9B-Chat-GGUF

LSXAxeller commented 1 month ago

Sorry,llama.cpp does not support custom chat_template. You can try using the package named "llama-cpp-python", which supports custom chat_template(example:[]sytem_message[reserved_0]user_message[reserved_1]response).

reference:https://huggingface.co/IndexTeam/Index-1.9B-Chat-GGUF

I am already using the sliced prompt as mentioned above, but it still have the spaces between words chars, and my frontend isn't based on python so I can't refer to llama-cpp-python, still this shouldn't be necessary since it's prompt issue not inference one, it depends on the dataset format not the backend

and [<unk>]sytem_message[reserved_0]user_message[reserved_1]response doesn't really give enough context, the repo should have a tested prompt format instead placeholders like sytem_message, user_message, response

asirgogogo commented 1 month ago

Suggestions:

  1. Check your version of llama.cpp.
  2. Use OLLAMA.

We will give some test prompt later!!!