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

Llama3 generating Incorrect and repeated response for my custom modelfile (finetuned llama3 8b) #4206

Open
balaji-2k1 opened this issue May 6, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@balaji-2k1
Copy link

balaji-2k1 commented May 6, 2024

What is the issue?

Fine-tuned the Llama3 8b model for my custom dataset following the llama3 template, used the unsloth library for fine-tuning, and generated the GGUF file.
Got relevant results when using this model for inference, but when I created the Modelfile and ran it as an Ollama process, the responses were irrelevant and repetitive.

Below is the prompt I used during the inference in the jupyter notebook (It generated the expected response):
prompt = """<|start_header_id|>system<|end_header_id|>You are Dbot, Respond to user questions naturally. <|eot_id|><|start_header_id|>user<|end_header_id|> {}<|eot_id|> <|start_header_id|>Dbot<|end_header_id|> {}<|eot_id|>"""

Below is my Modelfile
`FROM llama3_merged.gguf

TEMPLATE """<|start_header_id|>system<|end_header_id|>You are Dbot,
Respond to user questions naturally. >
<|eot_id|><|start_header_id|>user<|end_header_id|>
{{ .Prompt }}<|eot_id|>
<|start_header_id|>Dbot<|end_header_id|>
{{ .Response }}<|eot_id|>"""

PARAMETER stop "<|start_header_id|>"
PARAMETER stop "<|end_header_id|>"
PARAMETER stop "<|eot_id|>"
PARAMETER stop "<|reserved_special_token"
`
I used below command to run the Modelfile and infer the model which gave me irrelevant responses and did not stop.

`ollama run llama3:v1 "What is EoC"

EoC: Ecosystems and EoL: Ecosystems, EoP: Ecosystems, and EoT: Ecosystems.
The EoC: Ecosystems and EoL: Ecosystems, EoP: Ecosystems, and EoT: Ecosystems.
Ecosystems have a significant impact on the EoC: Ecosystems, EoL: Ecosystems, EoP: Ecosystems, and EoT: Ecosystems.
The EoL: Ecosystems, EoP: Ecosystems, and EoT: Ecosystems.
Ecosystems have a significant impact on the EoC: Ecosystems, EoL: Ecosystems, EoP: Ecosystems, and EoT: Ecosystems.
The EoL: Ecosystems, EoP: Ecosystems, and EoT: Ecosystems.
Ecosystems have a significant impact on the EoC: Ecosystems, EoL: Ecosystems, EoP: Ecosystems, and EoT: Ecosystems.
The EoP: Ecosystems, EoT: Ecosystems, and EoL: Ecosystems.
Ecosystems have a significant impact on the EoC: Ecosystems, EoL: Ecosystems, EoP: Ecosystems, and EoT: Ecosystems.
The EoT: Ecosystems, EoL: Ecosystems, EoP: Ecosystems, and EoE: Ecosystems.
Ecosystems have a significant impact on the EoC: Ecosystems, EoL: Ecosystems, EoP: Ecosystems, and EoT: Ecosystems.
The EoE: Ecosystems, EoL: Ecosystems, EoP: Ecosystems, and EoT: Ecosystems.
Ecosystems have a significant impact on the EoC: Ecosystems, EoL: Ecosystems, EoP: Ecosystems, and EoT: Ecosystems.
The EoT: Ecosystems, EoE: Ecosystems, and EoL: Ecosystems.
Ecosystems have a significant impact on the EoC: Ecos`

OS

Linux

GPU

Nvidia

CPU

Intel

Ollama version

0.1.32

@balaji-2k1 balaji-2k1 added the bug Something isn't working label May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant