mirror of
https://github.com/ollama/ollama-python.git
synced 2026-07-21 09:05:23 -04:00
ResponseError(without error information) when running with python #48
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Kaleemullahqasim on GitHub (Mar 6, 2024).
simple codes like below
ollama.chat(model='mistral:instruct', messages=[{'role': 'user', 'content': 'Why is the sky blue?'}])OR
An error is being thrown, but there is no specific issue being printed.
"It works perfectly fine in the command-line interface (CLI) when I run
ollama run mistral:instructHere is the error
@AboidoLiven commented on GitHub (May 25, 2024):
I met the same question, debugged the code and found that the error code is 502, I tried to find the place where the response is generated but the code wrapped too deep and is hard to locate precisely.
So I tried to use the python packge
requestdirectly and succeeded, here is the code:here is the result: