Skip to content

Commit 5b1c1e6

Browse files
authored
don't wait for first chunk to be uploaded to start all workers (#21)
1 parent 446ea44 commit 5b1c1e6

File tree

1 file changed

+12
-0
lines changed
  • src/huggingface_hub/commands

1 file changed

+12
-0
lines changed

src/huggingface_hub/commands/lfs.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,18 @@ def run(self):
189189
chunk_size = int(header.pop("chunk_size"))
190190
presigned_urls: List[str] = list(header.values())
191191

192+
# Send a "started" progress event to allow other workers to start.
193+
# Otherwise they're delayed until first "progress" event is reported,
194+
# i.e. after the first 5GB by default (!)
195+
write_msg(
196+
{
197+
"event": "progress",
198+
"oid": oid,
199+
"bytesSoFar": 1,
200+
"bytesSinceLast": 0,
201+
}
202+
)
203+
192204
parts = []
193205
for i, presigned_url in enumerate(presigned_urls):
194206
with FileSlice(

0 commit comments

Comments
 (0)