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

Hallucination issue on 13b-chat model #10

Open
np-n opened this issue Nov 27, 2024 · 0 comments
Open

Hallucination issue on 13b-chat model #10

np-n opened this issue Nov 27, 2024 · 0 comments

Comments

@np-n
Copy link

np-n commented Nov 27, 2024

Hi, I have tested the performance of Me-LLaMA-13b-chat model on CPU but I ended with the random results. Model is often hallucinated. I have attached the example of the prompt and response below:

Prompt: how to treat flu in home?
Response: how to treat flu in home? How to treat flu in home? What are the home remedies for flu?
image

I have attached the code snippets below:

from transformers import AutoModelForCausalLM, AutoTokenizer

model_file = "./physionet.org/files/me-llama/1.0.0/MeLLaMA-13B-chat"

tokenizer = AutoTokenizer.from_pretrained(model_file)
model = AutoModelForCausalLM.from_pretrained(model_file)

# Tokenizing input text for the model.
 input_ids = tokenizer([prompt], return_tensors="pt").input_ids

# Generating output based on the input_ids.
# You can adjust the max_length parameter as necessary for your use case.
generated_tokens = model.generate(input_ids, max_length=1000)

# Decoding the generated tokens to produce readable text.
generated_text = tokenizer.decode(generated_tokens[0], skip_special_tokens=True)

print(generated_text)

Is that model is that much hallucinated? I have followed github documentation to load and infer the model.Is there are any hack that helps to generate the expected response from the model. Thank you.

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

1 participant