Skip to content

Commit

Permalink
fix(ollama.py): correctly raise ollama streaming error
Browse files Browse the repository at this point in the history
Fixes #4974
  • Loading branch information
krrishdholakia committed Jul 30, 2024
1 parent 185a685 commit 311521e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions litellm/llms/ollama.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ def get_ollama_response(
logging_obj=logging_obj,
)
return response
elif stream == True:
elif stream is True:
return ollama_completion_stream(url=url, data=data, logging_obj=logging_obj)

response = requests.post(
Expand Down Expand Up @@ -326,7 +326,7 @@ def ollama_completion_stream(url, data, logging_obj):
try:
if response.status_code != 200:
raise OllamaError(
status_code=response.status_code, message=response.text
status_code=response.status_code, message=response.read()
)

streamwrapper = litellm.CustomStreamWrapper(
Expand Down

0 comments on commit 311521e

Please sign in to comment.