We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ef8c0f6 commit 478c670Copy full SHA for 478c670
torchvision/datasets/utils.py
@@ -26,7 +26,7 @@
26
27
def _urlretrieve(url: str, filename: Union[str, pathlib.Path], chunk_size: int = 1024 * 32) -> None:
28
with urllib.request.urlopen(urllib.request.Request(url, headers={"User-Agent": USER_AGENT})) as response:
29
- with open(filename, "wb") as fh, tqdm(total=response.length) as pbar:
+ with open(filename, "wb") as fh, tqdm(total=response.length, unit="B", unit_scale=True) as pbar:
30
while chunk := response.read(chunk_size):
31
fh.write(chunk)
32
pbar.update(len(chunk))
0 commit comments