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

ollama run qwen:0.5B, Reply exception, stuck in a loop. #2405

Closed
samzong opened this issue Feb 8, 2024 · 3 comments
Closed

ollama run qwen:0.5B, Reply exception, stuck in a loop. #2405

samzong opened this issue Feb 8, 2024 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@samzong
Copy link

samzong commented Feb 8, 2024

>>> /show info
Model details:
Family              qwen2
Parameter Size      620M
Quantization Level  Q4_0
~ uname -m -s -r
Darwin 23.3.0 arm64

image

20240208104056.mp4

/label bug

@bm777
Copy link

bm777 commented Feb 8, 2024

I had the same behavior with phi2 model. I noticed that the model gives the right or the expected answer before going to a new line (\n). So I had to add "\n" in the stop list.

const stream = await generate({
        model: "phi",
        prompt: text,
        stream: true,
        options: {
            num_predict: 70,
            temperature: 0.65,
            penalize_newline: true,
            top_p: 0.9,
            // presence_penalty: 0.6,
            stop: ["\n", "User:", "Assistant:", "User:"] //["\n"]
        }
    })

It still cuts at a wrong place sometimes, but I can manage to just remove the words after the last punctuation: . or ,
This method will not work if the user ask for a list as a result (give me 3 recipes of cappuccino) -> then after generating the first, the model will try to add a new line for the second element of the list, and it becomes more complicated to control the level.
(any workaround for this use case?)

Screenshot 2024-02-08 at 11 15 00

@jmorganca
Copy link
Member

The infinite generation should be fixed now. As for the poor responses from smaller models – this may be from the prompt template, prompt or other reasons – all of which we are trying to improve.

@bm777
Copy link

bm777 commented May 10, 2024

@jmorganca So we should update the Ollama binary verison then right ?

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

3 participants