Skip to content

Commit

Permalink
Merge branch 'main' of github.com:huggingface/autotrain-advanced into…
Browse files Browse the repository at this point in the history
… main
  • Loading branch information
abhishekkrthakur committed May 7, 2024
2 parents d83aa82 + 6aac70b commit 69fa23c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/autotrain/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,15 @@ def _poll_nvcf(self, url, token, method="get", timeout=86400, interval=30, op="p
logger.error("Failed to parse JSON from response")
continue

if response.status_code == 500:
logger.error("Training failed")
if "detail" in data:
detail_message = data["detail"]
for line in detail_message.split("\n"):
if line.strip():
print(line)
break

if response.status_code in [200, 202]:
logger.info(
f"{self.job_name}: {method} - {response.status_code} - {'Polling completed' if response.status_code == 200 else 'Polling reqId for completion'}"
Expand Down

0 comments on commit 69fa23c

Please sign in to comment.