Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

transformers-cli: LFS multipart uploads (> 5GB) #8663

Merged
merged 26 commits into from
Dec 7, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Revert "Tweak to FileSlice"
This reverts commit d7e32c4.
  • Loading branch information
julien-c committed Nov 20, 2020
commit fbd24cba89cc09a9108335d47a9b53b891b3cd2c
6 changes: 3 additions & 3 deletions src/transformers/commands/lfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,9 @@ def read(self, n=-1):
if self.n_seen >= self.read_limit:
return b""
remaining_amount = self.read_limit - self.n_seen
n_to_read = remaining_amount if n < 0 else min(n, remaining_amount)
self.n_seen += n_to_read
return self.f.read(n_to_read)
data = self.f.read(remaining_amount if n < 0 else min(n, remaining_amount))
self.n_seen += len(data)
return data

def __iter__(self):
yield self.read(n=4*1024*1024)
Expand Down