mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-12 23:01:41 +00:00
fix(ollama.py): correctly raise ollama streaming error
Fixes https://github.com/BerriAI/litellm/issues/4974
This commit is contained in:
parent
185a6857f9
commit
311521e56e
1 changed files with 2 additions and 2 deletions
|
|
@ -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(
|
||||
|
|
@ -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(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue