mirror of
https://github.com/clearml/clearml
synced 2025-05-07 14:24:31 +00:00
Fix TQDM upload/download reporting, remove warning
This commit is contained in:
parent
960165d425
commit
1a2d4749ad
@ -119,7 +119,10 @@ class ProgressReport(object):
|
||||
if _tqdm:
|
||||
# make sure we do not spill over due to rounding
|
||||
if round(float(current_mb), 2) >= _tqdm.total:
|
||||
_tqdm.update(_tqdm.total - self.last_reported)
|
||||
_tqdm.update(
|
||||
max(min(
|
||||
_tqdm.total - getattr(_tqdm, "n", self.last_reported), _tqdm.total - self.last_reported),
|
||||
0))
|
||||
else:
|
||||
_tqdm.update(current_mb - self.last_reported)
|
||||
else:
|
||||
@ -156,7 +159,7 @@ class UploadProgressReport(ProgressReport):
|
||||
log,
|
||||
report_chunk_size_mb,
|
||||
description_prefix="Uploading",
|
||||
description_suffix="to {}".format(filename),
|
||||
description_suffix="from {}".format(filename),
|
||||
report_start=report_start,
|
||||
)
|
||||
self._filename = filename
|
||||
|
@ -325,7 +325,8 @@ class _HttpDriver(_Driver):
|
||||
|
||||
res = container.session.post(url, data=m, timeout=timeout, headers=headers)
|
||||
if res.status_code != requests.codes.ok:
|
||||
raise ValueError("Failed uploading object %s (%d): %s" % (object_name, res.status_code, res.text))
|
||||
raise ValueError("Failed uploading object {} to {} ({}): {}".format(
|
||||
object_name, url, res.status_code, res.text))
|
||||
|
||||
# call back is useless because we are not calling it while uploading...
|
||||
return res
|
||||
|
Loading…
Reference in New Issue
Block a user