From bd1fe67f99f36b99fd4a0c1d01913f71e073b0c3 Mon Sep 17 00:00:00 2001 From: Casper da Costa-Luis Date: Sat, 17 Aug 2019 22:07:14 +0100 Subject: [PATCH] probably correct oss2 Tqdm units (sparse Mandarin documentation) --- dvc/remote/oss.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/dvc/remote/oss.py b/dvc/remote/oss.py index 108c1bc49..57e900087 100644 --- a/dvc/remote/oss.py +++ b/dvc/remote/oss.py @@ -107,7 +107,9 @@ class RemoteOSS(RemoteBASE): def _upload( self, from_file, to_info, name=None, no_progress_bar=False, **_kwargs ): - with Tqdm(desc_truncate=name, disable=no_progress_bar) as pbar: + with Tqdm( + desc_truncate=name, disable=no_progress_bar, bytes=True + ) as pbar: self.oss_service.put_object_from_file( to_info.path, from_file, progress_callback=pbar.update_to ) @@ -115,7 +117,9 @@ class RemoteOSS(RemoteBASE): def _download( self, from_info, to_file, name=None, no_progress_bar=False, **_kwargs ): - with Tqdm(desc_truncate=name, disable=no_progress_bar) as pbar: + with Tqdm( + desc_truncate=name, disable=no_progress_bar, bytes=True + ) as pbar: self.oss_service.get_object_to_file( from_info.path, to_file, progress_callback=pbar.update_to )