Skip to content

Commit

Permalink
Update translator.py
Browse files Browse the repository at this point in the history
  • Loading branch information
carlospolop authored May 16, 2024
1 parent a2f1fa3 commit 8410271
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions scripts/translator.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@ def translate_text(language, text, file_path, model, cont=0, slpitted=False, cli
if cont > 6:
print(f"Page {file_path} could not be translated due to count with text: {text}\nReturning text as is.")
return text
if "exceeded your current quota" in str(e).lower():
print("Critical error: Quota exceeded")
exit(1)

if "is currently overloaded" in str(e).lower():
print("Overloaded, waiting 30 seconds")
Expand Down

0 comments on commit 8410271

Please sign in to comment.