[GH-ISSUE #4899] Failed to get max tokens for LLM with name qwen2:7b-instruct-fp16 with ollama #65130

Closed
opened 2026-05-03 19:48:46 -05:00 by GiteaMirror · 2 comments
Owner

Originally created by @wenlong1234 on GitHub (Jun 7, 2024).
Original GitHub issue: https://github.com/ollama/ollama/issues/4899

What is the issue?

utils.py 328 : Failed to get max tokens for LLM with name qwen2:7b-instruct-fp16. Defaulting to 4096.
api_server-1 | Traceback (most recent call last):
api_server-1 | File "/app/danswer/llm/utils.py", line 318, in get_llm_max_tokens
api_server-1 | model_obj = model_map[model_name]
api_server-1 | ~~~~~~~~~^^^^^^^^^^^^
api_server-1 | KeyError: 'qwen2:7b-instruct-fp16'

OS

No response

GPU

AMD

CPU

AMD

Ollama version

0.1.41

Originally created by @wenlong1234 on GitHub (Jun 7, 2024). Original GitHub issue: https://github.com/ollama/ollama/issues/4899 ### What is the issue? utils.py 328 : Failed to get max tokens for LLM with name qwen2:7b-instruct-fp16. Defaulting to 4096. api_server-1 | Traceback (most recent call last): api_server-1 | File "/app/danswer/llm/utils.py", line 318, in get_llm_max_tokens api_server-1 | model_obj = model_map[model_name] api_server-1 | ~~~~~~~~~^^^^^^^^^^^^ api_server-1 | KeyError: 'qwen2:7b-instruct-fp16' ### OS _No response_ ### GPU AMD ### CPU AMD ### Ollama version 0.1.41
GiteaMirror added the bug label 2026-05-03 19:48:46 -05:00
Author
Owner

@jmorganca commented on GitHub (Jun 9, 2024):

Thanks for the issue. Make sure to download the model: ollama pull qwen2:7b-instruct-fp16 - let me know if that doesn't fix it

<!-- gh-comment-id:2156707676 --> @jmorganca commented on GitHub (Jun 9, 2024): Thanks for the issue. Make sure to download the model: `ollama pull qwen2:7b-instruct-fp16` - let me know if that doesn't fix it
Author
Owner

@lucashaha commented on GitHub (Jun 11, 2024):

sorry,it is not ollma problem,thanks。

<!-- gh-comment-id:2159608236 --> @lucashaha commented on GitHub (Jun 11, 2024): sorry,it is not ollma problem,thanks。
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#65130