Merge pull request #34 from chenxizhang/patch-1

error handling code
This commit is contained in:
Michael Yang
2024-01-29 09:54:43 -08:00
committed by GitHub
+1 -1
View File
@@ -162,7 +162,7 @@ model = 'does-not-yet-exist'
try:
ollama.chat(model)
except ollama.ResponseError as e:
print('Error:', e.content)
print('Error:', e.error)
if e.status_code == 404:
ollama.pull(model)
```