You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ollama.chat(model='mistral:instruct', messages=[{'role': 'user', 'content': 'Why is the sky blue?'}])
OR
import ollama
response = ollama.chat(model='mistral:instruct', messages=[
{
'role': 'user',
'content': 'Why is the sky blue?',
},
])
print(response['message']['content'])`
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:instruct
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 request directly and succeeded, here is the code:
{
"model": "phi3",
"created_at": "2024-05-25T14:55:39.889174Z",
"message": {
"role": "assistant",
"content": " The sky appears blue to the human eye because of a phenomenon called Rayleigh scattering. As sunlight travels through Earth's atmosphere, it encounters molecules and small particles which scatter the light in all directions. Blue light has a shorter wavelength and is scattered more than other colors since it travels as shorter, smaller waves. This selective scattering causes the sky to look blue in the daytime. However, at sunrise and sunset, the light passes through more of Earth's atmosphere, which scatters away most of the blue light, allowing reds, oranges, and yellows to dominate our view."
},
"done_reason": "stop",
"done": true,
"total_duration": 5341346800,
"load_duration": 2678940100,
"prompt_eval_count": 13,
"prompt_eval_duration": 61936000,
"eval_count": 139,
"eval_duration": 2598396000
}
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:instruct
Here is the error
The text was updated successfully, but these errors were encountered: