zhiminy commited on
Commit
87c2ab6
·
1 Parent(s): 0fd77fe
Files changed (2) hide show
  1. app.py +12 -4
  2. msr.py +12 -4
app.py CHANGED
@@ -122,9 +122,11 @@ def is_rate_limit_error(e):
122
  backoff.expo,
123
  HfHubHTTPError,
124
  max_tries=8,
 
 
125
  giveup=lambda e: not is_rate_limit_error(e),
126
  on_backoff=lambda details: print(
127
- f"⏳ Rate limited. Retrying in {details['wait']:.1f}s (attempt {details['tries']}/8)..."
128
  )
129
  )
130
  def upload_large_folder_with_backoff(api, **kwargs):
@@ -136,9 +138,11 @@ def upload_large_folder_with_backoff(api, **kwargs):
136
  backoff.expo,
137
  HfHubHTTPError,
138
  max_tries=8,
 
 
139
  giveup=lambda e: not is_rate_limit_error(e),
140
  on_backoff=lambda details: print(
141
- f"⏳ Rate limited. Retrying in {details['wait']:.1f}s (attempt {details['tries']}/8)..."
142
  )
143
  )
144
  def list_repo_files_with_backoff(api, **kwargs):
@@ -150,9 +154,11 @@ def list_repo_files_with_backoff(api, **kwargs):
150
  backoff.expo,
151
  HfHubHTTPError,
152
  max_tries=8,
 
 
153
  giveup=lambda e: not is_rate_limit_error(e),
154
  on_backoff=lambda details: print(
155
- f"⏳ Rate limited. Retrying in {details['wait']:.1f}s (attempt {details['tries']}/8)..."
156
  )
157
  )
158
  def hf_hub_download_with_backoff(**kwargs):
@@ -164,9 +170,11 @@ def hf_hub_download_with_backoff(**kwargs):
164
  backoff.expo,
165
  HfHubHTTPError,
166
  max_tries=8,
 
 
167
  giveup=lambda e: not is_rate_limit_error(e),
168
  on_backoff=lambda details: print(
169
- f"⏳ Rate limited. Retrying in {details['wait']:.1f}s (attempt {details['tries']}/8)..."
170
  )
171
  )
172
  def upload_file_with_backoff(api, **kwargs):
 
122
  backoff.expo,
123
  HfHubHTTPError,
124
  max_tries=8,
125
+ base=300,
126
+ max_value=3600,
127
  giveup=lambda e: not is_rate_limit_error(e),
128
  on_backoff=lambda details: print(
129
+ f"⏳ Rate limited. Retrying in {details['wait']/60:.1f} minutes ({details['wait']:.0f}s) - attempt {details['tries']}/8..."
130
  )
131
  )
132
  def upload_large_folder_with_backoff(api, **kwargs):
 
138
  backoff.expo,
139
  HfHubHTTPError,
140
  max_tries=8,
141
+ base=300,
142
+ max_value=3600,
143
  giveup=lambda e: not is_rate_limit_error(e),
144
  on_backoff=lambda details: print(
145
+ f"⏳ Rate limited. Retrying in {details['wait']/60:.1f} minutes ({details['wait']:.0f}s) - attempt {details['tries']}/8..."
146
  )
147
  )
148
  def list_repo_files_with_backoff(api, **kwargs):
 
154
  backoff.expo,
155
  HfHubHTTPError,
156
  max_tries=8,
157
+ base=300,
158
+ max_value=3600,
159
  giveup=lambda e: not is_rate_limit_error(e),
160
  on_backoff=lambda details: print(
161
+ f"⏳ Rate limited. Retrying in {details['wait']/60:.1f} minutes ({details['wait']:.0f}s) - attempt {details['tries']}/8..."
162
  )
163
  )
164
  def hf_hub_download_with_backoff(**kwargs):
 
170
  backoff.expo,
171
  HfHubHTTPError,
172
  max_tries=8,
173
+ base=300,
174
+ max_value=3600,
175
  giveup=lambda e: not is_rate_limit_error(e),
176
  on_backoff=lambda details: print(
177
+ f"⏳ Rate limited. Retrying in {details['wait']/60:.1f} minutes ({details['wait']:.0f}s) - attempt {details['tries']}/8..."
178
  )
179
  )
180
  def upload_file_with_backoff(api, **kwargs):
msr.py CHANGED
@@ -112,9 +112,11 @@ def is_rate_limit_error(e):
112
  backoff.expo,
113
  HfHubHTTPError,
114
  max_tries=8,
 
 
115
  giveup=lambda e: not is_rate_limit_error(e),
116
  on_backoff=lambda details: print(
117
- f"⏳ Rate limited. Retrying in {details['wait']:.1f}s (attempt {details['tries']}/8)..."
118
  )
119
  )
120
  def upload_large_folder_with_backoff(api, **kwargs):
@@ -126,9 +128,11 @@ def upload_large_folder_with_backoff(api, **kwargs):
126
  backoff.expo,
127
  HfHubHTTPError,
128
  max_tries=8,
 
 
129
  giveup=lambda e: not is_rate_limit_error(e),
130
  on_backoff=lambda details: print(
131
- f"⏳ Rate limited. Retrying in {details['wait']:.1f}s (attempt {details['tries']}/8)..."
132
  )
133
  )
134
  def list_repo_files_with_backoff(api, **kwargs):
@@ -140,9 +144,11 @@ def list_repo_files_with_backoff(api, **kwargs):
140
  backoff.expo,
141
  HfHubHTTPError,
142
  max_tries=8,
 
 
143
  giveup=lambda e: not is_rate_limit_error(e),
144
  on_backoff=lambda details: print(
145
- f"⏳ Rate limited. Retrying in {details['wait']:.1f}s (attempt {details['tries']}/8)..."
146
  )
147
  )
148
  def hf_hub_download_with_backoff(**kwargs):
@@ -154,9 +160,11 @@ def hf_hub_download_with_backoff(**kwargs):
154
  backoff.expo,
155
  HfHubHTTPError,
156
  max_tries=8,
 
 
157
  giveup=lambda e: not is_rate_limit_error(e),
158
  on_backoff=lambda details: print(
159
- f"⏳ Rate limited. Retrying in {details['wait']:.1f}s (attempt {details['tries']}/8)..."
160
  )
161
  )
162
  def upload_file_with_backoff(api, **kwargs):
 
112
  backoff.expo,
113
  HfHubHTTPError,
114
  max_tries=8,
115
+ base=300,
116
+ max_value=3600,
117
  giveup=lambda e: not is_rate_limit_error(e),
118
  on_backoff=lambda details: print(
119
+ f"⏳ Rate limited. Retrying in {details['wait']/60:.1f} minutes ({details['wait']:.0f}s) - attempt {details['tries']}/8..."
120
  )
121
  )
122
  def upload_large_folder_with_backoff(api, **kwargs):
 
128
  backoff.expo,
129
  HfHubHTTPError,
130
  max_tries=8,
131
+ base=300,
132
+ max_value=3600,
133
  giveup=lambda e: not is_rate_limit_error(e),
134
  on_backoff=lambda details: print(
135
+ f"⏳ Rate limited. Retrying in {details['wait']/60:.1f} minutes ({details['wait']:.0f}s) - attempt {details['tries']}/8..."
136
  )
137
  )
138
  def list_repo_files_with_backoff(api, **kwargs):
 
144
  backoff.expo,
145
  HfHubHTTPError,
146
  max_tries=8,
147
+ base=300,
148
+ max_value=3600,
149
  giveup=lambda e: not is_rate_limit_error(e),
150
  on_backoff=lambda details: print(
151
+ f"⏳ Rate limited. Retrying in {details['wait']/60:.1f} minutes ({details['wait']:.0f}s) - attempt {details['tries']}/8..."
152
  )
153
  )
154
  def hf_hub_download_with_backoff(**kwargs):
 
160
  backoff.expo,
161
  HfHubHTTPError,
162
  max_tries=8,
163
+ base=300,
164
+ max_value=3600,
165
  giveup=lambda e: not is_rate_limit_error(e),
166
  on_backoff=lambda details: print(
167
+ f"⏳ Rate limited. Retrying in {details['wait']/60:.1f} minutes ({details['wait']:.0f}s) - attempt {details['tries']}/8..."
168
  )
169
  )
170
  def upload_file_with_backoff(api, **kwargs):