Skip to content

Llama2 answers is noise #615

Closed
Closed
@ghost

Description

I tried to use Llama2, code is executing but the results are random character, what is wrong?

llm = LLM(model="/home/gpt/.cache/huggingface/hub/models--meta-llama--Llama-2-13b-hf/snapshots/bff3f0e93147eb2c18aa8a888e73f010d8935d17")
prompts = [
    "I am so fast that I can",
    "The capital of France is",
    "The future of AI is",
]
sampling_params = SamplingParams(temperature=0.8, top_p=0.95)
outputs = llm.generate(prompts, sampling_params)

# Print the outputs.
for output in outputs:
    prompt = output.prompt
    generated_text = output.outputs[0].text
    print(f"Prompt: {prompt!r}, Generated text: {generated_text!r}")

and got

Prompt: 'I am so fast that I can', Generated text: 'hd canciónbólści Zum framідnexProgram nov напskieWrapperabi go totale'
Prompt: 'The capital of France is', Generated text: 'Business Stock vieerves beskrevsiska}$. програкли laugh ","readerattednexшње савезној'
Prompt: 'The future of AI is', Generated text: "pleasure Mohрю Democratic Pel.»)}{ Foi Referencias maven Yeah beyond encryption river Catalunya '"

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions