Skip to content

Commit

Permalink
don't wait for first chunk to be uploaded to start all workers (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierrci authored Mar 3, 2021
1 parent 446ea44 commit 5b1c1e6
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/huggingface_hub/commands/lfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,18 @@ def run(self):
chunk_size = int(header.pop("chunk_size"))
presigned_urls: List[str] = list(header.values())

# Send a "started" progress event to allow other workers to start.
# Otherwise they're delayed until first "progress" event is reported,
# i.e. after the first 5GB by default (!)
write_msg(
{
"event": "progress",
"oid": oid,
"bytesSoFar": 1,
"bytesSinceLast": 0,
}
)

parts = []
for i, presigned_url in enumerate(presigned_urls):
with FileSlice(
Expand Down

0 comments on commit 5b1c1e6

Please sign in to comment.