[GH-ISSUE #4713] Codestral doesn't output correct response #49482

Closed
opened 2026-04-28 11:59:01 -05:00 by GiteaMirror · 11 comments
Owner

Originally created by @jasonhotsauce on GitHub (May 30, 2024).
Original GitHub issue: https://github.com/ollama/ollama/issues/4713

Originally assigned to: @jmorganca on GitHub.

What is the issue?

Example:

>>> write a python function to calculate fibonacci sequence
[control_8][control_11][control_19][control_35][control_18][control_11]▅[control_20][control_20][control_20][TOOL_RESULTS][control_27][control_32][control_20][control_8][control_11][control_19][control_35][control_18][control_11]▅[control_20][control_20][control_20][TOOL_RESULTS][control_27][control_32][control_20][control_32][control_19][control_21][control_26][control_19][/TOOL_RESULTS][control_11][control_30][control_16][control_14]

>>> /bye

OS

macOS

GPU

Apple

CPU

Apple

Ollama version

0.1.39

Originally created by @jasonhotsauce on GitHub (May 30, 2024). Original GitHub issue: https://github.com/ollama/ollama/issues/4713 Originally assigned to: @jmorganca on GitHub. ### What is the issue? Example: ``` >>> write a python function to calculate fibonacci sequence [control_8][control_11][control_19][control_35][control_18][control_11]▅[control_20][control_20][control_20][TOOL_RESULTS][control_27][control_32][control_20][control_8][control_11][control_19][control_35][control_18][control_11]▅[control_20][control_20][control_20][TOOL_RESULTS][control_27][control_32][control_20][control_32][control_19][control_21][control_26][control_19][/TOOL_RESULTS][control_11][control_30][control_16][control_14] >>> /bye ``` ### OS macOS ### GPU Apple ### CPU Apple ### Ollama version 0.1.39
GiteaMirror added the bug label 2026-04-28 11:59:01 -05:00
Author
Owner

@cwijayasundara commented on GitHub (May 30, 2024):

I see the same error with codestral:latest

I use a M1 with 16 GB RAM with Ollama 0.1.39

<!-- gh-comment-id:2138816187 --> @cwijayasundara commented on GitHub (May 30, 2024): I see the same error with codestral:latest I use a M1 with 16 GB RAM with Ollama 0.1.39
Author
Owner

@MrShenhongbo commented on GitHub (May 30, 2024):

me too!

<!-- gh-comment-id:2139009935 --> @MrShenhongbo commented on GitHub (May 30, 2024): me too!
Author
Owner

@maxruby commented on GitHub (May 30, 2024):

MacBook Pro M1
Sonoma 14.4
16 GB RAM
ollama version is 0.1.39

>>> 10 + 10
[control_34][control_23]▅[control_25][control_8][control_14][control_15]
<!-- gh-comment-id:2139122230 --> @maxruby commented on GitHub (May 30, 2024): MacBook Pro M1 Sonoma 14.4 16 GB RAM ollama version is 0.1.39 ``` >>> 10 + 10 [control_34][control_23]▅[control_25][control_8][control_14][control_15] ```
Author
Owner

@mosh98 commented on GitHub (May 30, 2024):

same here.

Assuming it's something with the tokenizer

<!-- gh-comment-id:2139156986 --> @mosh98 commented on GitHub (May 30, 2024): same here. Assuming it's something with the tokenizer
Author
Owner

@yangroro commented on GitHub (May 30, 2024):

Same here
M1
Sonoma 14.5
16GB RAM
ollama version is 0.1.39

<!-- gh-comment-id:2140192243 --> @yangroro commented on GitHub (May 30, 2024): Same here M1 Sonoma 14.5 16GB RAM ollama version is 0.1.39
Author
Owner

@ZanMax commented on GitHub (May 31, 2024):

Works fine with (M2, 64 GB RAM, Sonoma 14.5)

`ollama run codestral

write a python function to calculate fibonacci sequence
Sure, here is a simple Python function that calculates the Fibonacci sequence up to the nth term:

def fibonacci(n):
    if n <= 0:
        return "Input should be positive integer."
    elif n == 1:
        return [0]
    elif n == 2:
        return [0, 1]
    else:
        sequence = [0, 1]
        while len(sequence) < n:
            sequence.append(sequence[-1] + sequence[-2])
        return sequence

You can use this function by calling it with the number of terms you want to generate as an argument, like so:

print(fibonacci(10))

This will print the first 10 numbers in the Fibonacci sequence.

10 + 10
The expression "10 + 10" does not have any relation to the previously defined function or the concept of the Fibonacci sequence. It's a simple arithmetic operation that adds two numbers together, and in
this case, it results in 20.`

<!-- gh-comment-id:2141286300 --> @ZanMax commented on GitHub (May 31, 2024): Works fine with (M2, 64 GB RAM, Sonoma 14.5) `ollama run codestral >>> write a python function to calculate fibonacci sequence Sure, here is a simple Python function that calculates the Fibonacci sequence up to the nth term: ```python def fibonacci(n): if n <= 0: return "Input should be positive integer." elif n == 1: return [0] elif n == 2: return [0, 1] else: sequence = [0, 1] while len(sequence) < n: sequence.append(sequence[-1] + sequence[-2]) return sequence ``` You can use this function by calling it with the number of terms you want to generate as an argument, like so: ```python print(fibonacci(10)) ``` This will print the first 10 numbers in the Fibonacci sequence. >>> 10 + 10 The expression "10 + 10" does not have any relation to the previously defined function or the concept of the Fibonacci sequence. It's a simple arithmetic operation that adds two numbers together, and in this case, it results in 20.`
Author
Owner

@jasonhotsauce commented on GitHub (May 31, 2024):

Is it only a M1 issue then?

<!-- gh-comment-id:2142731317 --> @jasonhotsauce commented on GitHub (May 31, 2024): Is it only a M1 issue then?
Author
Owner

@ZanMax commented on GitHub (May 31, 2024):

I think it's a problem with the amount of RAM.
v0.1.40 already has a fix: "Fixed out of memory and incorrect token issues when running Codestral on 16GB Macs"

<!-- gh-comment-id:2142736870 --> @ZanMax commented on GitHub (May 31, 2024): I think it's a problem with the amount of RAM. v0.1.40 already has a fix: "Fixed out of memory and incorrect token issues when running Codestral on 16GB Macs"
Author
Owner

@jimccadm commented on GitHub (Jun 1, 2024):

Same here also
M1
Sonoma 14.5
16GB RAM
ollama version is 0.1.39

ZanMax - thanks for the update on 1.40 will try when I can.

<!-- gh-comment-id:2143501219 --> @jimccadm commented on GitHub (Jun 1, 2024): Same here also M1 Sonoma 14.5 16GB RAM ollama version is 0.1.39 ZanMax - thanks for the update on 1.40 will try when I can.
Author
Owner

@maxruby commented on GitHub (Jun 1, 2024):

MacBook Pro M1 Sonoma 14.4 16 GB RAM ollama version is 0.1.39

>>> 10 + 10
[control_34][control_23]▅[control_25][control_8][control_14][control_15]

I can confirm that 0.1.40 fixes the output issue on M1 with 16 GB RAM.
Be warned, in my experience codestral responses are extremely slow most likely due to the limited RAM available.

<!-- gh-comment-id:2143506522 --> @maxruby commented on GitHub (Jun 1, 2024): > MacBook Pro M1 Sonoma 14.4 16 GB RAM ollama version is 0.1.39 > > ``` > >>> 10 + 10 > [control_34][control_23]▅[control_25][control_8][control_14][control_15] > ``` I can confirm that `0.1.40` fixes the output issue on M1 with 16 GB RAM. Be warned, in my experience codestral responses are extremely slow most likely due to the limited RAM available.
Author
Owner

@jmorganca commented on GitHub (Nov 17, 2024):

Closing as this is fixed. Thanks for the help, all!

<!-- gh-comment-id:2481633677 --> @jmorganca commented on GitHub (Nov 17, 2024): Closing as this is fixed. Thanks for the help, all!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#49482