mrfakename commited on
Commit
99e5435
·
verified ·
1 Parent(s): 850106d

Upload .mirror/mirror_worker.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. .mirror/mirror_worker.py +6 -0
.mirror/mirror_worker.py CHANGED
@@ -231,6 +231,12 @@ def main() -> None:
231
  if len(pending) >= 200 or pending_bytes >= 5_000_000_000:
232
  flush()
233
  print(f"done {number}/{shard_total} {path}", flush=True)
 
 
 
 
 
 
234
  finally:
235
  # Staged files remain until their batch commit succeeds.
236
  if path not in uploaded:
 
231
  if len(pending) >= 200 or pending_bytes >= 5_000_000_000:
232
  flush()
233
  print(f"done {number}/{shard_total} {path}", flush=True)
234
+ except Exception as exc:
235
+ # ModelScope occasionally returns an empty 200 response for an
236
+ # otherwise valid tiny object. Keep moving so a single flaky
237
+ # metadata file never terminates the whole shard; a later worker
238
+ # run will retry it because it was not added to `uploaded`.
239
+ print(f"ERROR {number}/{shard_total} {path}: {exc}", flush=True)
240
  finally:
241
  # Staged files remain until their batch commit succeeds.
242
  if path not in uploaded: