#16892·ollama

glm-ocr infinite loop

Author: sherpyaCreated Jun 24, 2026Updated Sep 17, 2026
Labelsbug

What is the issue?

ollama run glm-ocr Text Recognition: ./image.png

the output text loops indefinitely

even hi loops:

>>> hi
Happy birthday to you!
I hope you have a wonderful day and enjoy your birthday. Have a great time with friends and family. Happy birthday to you!
I wish you a happy birthday. May your life be filled with joy, laughter, and success. Have a great day and enjoy your 
birthday. Happy birthday to you!
Happy birthday to you!
Happy birthday to you!
Happy birthday to you!
Happy birthday to you!
Happy birthday to you!
Happy birthday to you!
Happy birthday to you!
Happy birthday to you!
Happy birthday to you!
Happy birthday to you!
Happy birthday to you!
Happy birthday to you!
Happy birthday to you!
Happy birthday to you!
Happy birthday to you!
Happy birthday to you!
Happy birthday to you!
...

Relevant log output

Jun 24 19:24:24 propheta ollama[768]: [GIN] 2026/06/24 - 19:24:24 | 200 |      16.265µs |       127.0.0.1 | HEAD     "/"
Jun 24 19:24:24 propheta ollama[768]: [GIN] 2026/06/24 - 19:24:24 | 200 |    1.109476ms |       127.0.0.1 | POST     "/api/show"
Jun 24 19:24:24 propheta ollama[768]: slot get_availabl: id  0 | task -1 | selected slot by LCP similarity, sim_best = 1.000 (> 0.100 thold), f_keep = 0.589
Jun 24 19:24:24 propheta ollama[768]: slot launch_slot_: id  0 | task -1 | sampler chain: logits -> penalties -> ?dry -> ?top-n-sigma -> top-k -> ?typical -> top-p -> ?min-p -> ?xtc -> temp-ext -> dist
Jun 24 19:24:24 propheta ollama[768]: slot launch_slot_: id  0 | task -1 | sampler params:
Jun 24 19:24:24 propheta ollama[768]:         repeat_last_n = 64, repeat_penalty = 1.100, frequency_penalty = 0.000, presence_penalty = 0.000
Jun 24 19:24:24 propheta ollama[768]:         dry_multiplier = 0.000, dry_base = 1.750, dry_allowed_length = 2, dry_penalty_last_n = 131072
Jun 24 19:24:24 propheta ollama[768]:         top_k = 40, top_p = 0.900, min_p = 0.000, xtc_probability = 0.000, xtc_threshold = 0.100, typical_p = 1.000, top_n_sigma = -1.000, temp = 0.000
Jun 24 19:24:24 propheta ollama[768]:         mirostat = 0, mirostat_lr = 0.100, mirostat_ent = 5.000, adaptive_target = -1.000, adaptive_decay = 0.900
Jun 24 19:24:24 propheta ollama[768]: slot launch_slot_: id  0 | task 1986 | processing task, is_child = 0
Jun 24 19:24:24 propheta ollama[768]: slot update_slots: id  0 | task 1986 | new prompt, n_ctx_slot = 131072, n_keep = 4, task.n_tokens = 696
Jun 24 19:24:24 propheta ollama[768]: slot update_slots: id  0 | task 1986 | need to evaluate at least 1 token for each active slot (n_past = 696, task.n_tokens() = 696)
Jun 24 19:24:24 propheta ollama[768]: slot update_slots: id  0 | task 1986 | n_past was set to 695
Jun 24 19:24:24 propheta ollama[768]: slot update_slots: id  0 | task 1986 | cached n_tokens = 695, memory_seq_rm [47, end)
Jun 24 19:24:24 propheta ollama[768]: slot init_sampler: id  0 | task 1986 | init sampler, took 0.01 ms, tokens: text = 12, total = 696
Jun 24 19:24:24 propheta ollama[768]: slot print_timing: id  0 | task 1986 | n_decoded =    100, tg = 322.25 t/s
Jun 24 19:24:26 propheta ollama[768]: [GIN] 2026/06/24 - 19:24:26 | 200 |  1.738016916s |       127.0.0.1 | POST     "/api/generate"
Jun 24 19:24:26 propheta ollama[768]: srv          stop: cancel task, id_task = 1986
Jun 24 19:24:26 propheta ollama[768]: slot      release: id  0 | task 1986 | stop processing: n_tokens = 1222, truncated = 0
Jun 24 19:24:26 propheta ollama[768]: srv  update_slots: all slots are idle

OS

Linux Ubuntu 24.04

GPU

3x 3090 24 GB

CPU

Intel(R) Core(TM) i5-10600KF CPU @ 4.10GHz

Ollama version

0.30.10