Skip to content

Commit

Permalink
Fix for #158 (#162)
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh-XT authored Apr 29, 2023
1 parent 6c2fced commit 3a6a9d1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions provider/huggingchat.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,10 @@ def instruct(self, prompt: str) -> str:
},
stream=True,
)

assert res.status_code == 200, "Failed to send message"
if res.status_code != 200:
print(f"Status code: {res.status_code}")
print(f"Response content: {res.content}")
raise Exception("Failed to send prompt to AI")

last_response = None
for chunk in res.iter_content(chunk_size=None):
Expand Down

0 comments on commit 3a6a9d1

Please sign in to comment.