guinmoon / LLMFarm

llama and other large language models on iOS and MacOS offline using GGML library.
https://llmfarm.site
MIT License
1.05k stars 62 forks source link

Prompt format for Llama 3 #60

Closed iamwillpowers closed 1 month ago

iamwillpowers commented 2 months ago

My prompt format, following discussions I've seen here and on the llama.cpp repo is as follows:

"<|begin_of_text|><|start_header_id|>system<|end_header_id|>{system_prompt}<|eot_id|><|start_header_id|>user<|end_header_id|>{prompt}<|eot_id|><|start_header_id|>assistant<|end_header_id|>\n"

For the reverse_prompt, I'm just using <|eot_id|>.

The first response is coherent, but the second response seems to repeat the original response as a fragment. Can someone identify what I'm doing incorrectly?

guinmoon commented 1 month ago

I recently added a template for llama 3, try using it.