Skip to content

Hallucination issue on 13b-chat model #10

@np-n

Description

@np-n

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions