Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

提示词模板格式是什么,如何避免生成结果混乱? #304

Closed
linonetwo opened this issue Apr 13, 2024 · 4 comments
Closed

Comments

@linonetwo
Copy link

图片

我目前使用这样的模板

template: '{{systemPrompt}}\n{{history}}model:{{completion}}\nuser:',

结果生成结果非常不好,请问 qwen1.5 gguf 需要使用什么样的提示词模板呢,文档里暂时没看到,是否有 Jinja 模板可以参考?例如

template: '<|im_start|>system\n{{systemPrompt}}<|im_end|>\n{{history}}<|im_start|>model:{{completion}}<|im_end|>\nuser:',
@jklj077
Copy link
Collaborator

jklj077 commented Apr 16, 2024

The chat template is embedded in the official GGUF files. They are also provided in tokenizer.json as the standard practice in transformers. For example, https://huggingface.co/Qwen/Qwen1.5-72B-Chat/blob/main/tokenizer_config.json#L31.

@linonetwo
Copy link
Author

linonetwo commented Apr 16, 2024

I'm using llama.cpp https://github.com/withcatai/node-llama-cpp , how to use the embedding template?

chat template is embedded in the official GGUF files.


It will use embedding template if you not passing a custom template.

And that is what I did, and I get messy result. So it mighe be caused by tokenlizer? I'm not sure, and I am going to try that.

@jklj077
Copy link
Collaborator

jklj077 commented Apr 30, 2024

If you're not using llama.cpp but node-llama-cpp, it is most likely a problem of node-llama-cpp. Please report to them.

@jklj077 jklj077 closed this as completed Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants