ruslanmv commited on
Commit
6fd4401
·
verified ·
1 Parent(s): 9d812fb

Update tool2.py

Browse files
Files changed (1) hide show
  1. tool2.py +9 -1
tool2.py CHANGED
@@ -74,4 +74,12 @@ for attempt in range(max_retries):
74
  client_2 = Client("ruslanmv/Text-To-Speech")
75
  clients.append(client_2)
76
  print("Loaded TTS client (client_2) ✔")
77
- break # If successful, break
 
 
 
 
 
 
 
 
 
74
  client_2 = Client("ruslanmv/Text-To-Speech")
75
  clients.append(client_2)
76
  print("Loaded TTS client (client_2) ✔")
77
+ break # If successful, break out of the retry loop
78
+ except httpx.ReadTimeout as e:
79
+ print(f"Attempt {attempt + 1} failed with ReadTimeout: {e}")
80
+ if attempt < max_retries - 1:
81
+ print(f"Retrying in {retry_delay} seconds...")
82
+ time.sleep(retry_delay)
83
+ else:
84
+ print("Max retries reached for TTS client (client_2). It may not be available.")
85
+ client_2 =