diff --git a/ollama/_client.py b/ollama/_client.py index 87fa881..b7439c2 100644 --- a/ollama/_client.py +++ b/ollama/_client.py @@ -167,6 +167,8 @@ def inner(): raise ResponseError(e.response.text, e.response.status_code) from None for line in r.iter_lines(): + if not line: + continue part = json.loads(line) if err := part.get('error'): raise ResponseError(err)