Skip to content

Commit 0f3d1b2

Browse files
authored
Remove download progress reporting (#15946)
It's not compatible with #15933 which cause 2^70+ byte counters like ``` Downloaded: 839890544179019776 / 1354151797 bytes (62023367397.93%) Downloaded: 841813590016000000 / 1354151797 bytes (62165378496.04%) ```
1 parent 8b23f34 commit 0f3d1b2

File tree

1 file changed

+0
-22
lines changed

1 file changed

+0
-22
lines changed

backends/qualcomm/scripts/download_qnn_sdk.py

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,6 @@ def _download_archive(url: str, archive_path: pathlib.Path) -> bool:
134134
with session.get(url, stream=True) as r:
135135
r.raise_for_status()
136136

137-
total = int(r.headers.get("content-length", 0))
138137
downloaded = 0
139138
chunk_size = 1024 * 1024 # 1MB
140139

@@ -143,7 +142,6 @@ def _download_archive(url: str, archive_path: pathlib.Path) -> bool:
143142
if chunk:
144143
f.write(chunk)
145144
downloaded += len(chunk)
146-
_make_report_progress()(downloaded, downloaded, total)
147145

148146
logger.info("Download completed!")
149147

@@ -161,26 +159,6 @@ def _download_archive(url: str, archive_path: pathlib.Path) -> bool:
161159
return True
162160

163161

164-
def _make_report_progress():
165-
"""Return a callback to report download progress."""
166-
last_reported = 0
167-
168-
def report_progress(block_num, block_size, total_size):
169-
nonlocal last_reported
170-
try:
171-
downloaded = block_num * block_size
172-
percent = downloaded / total_size * 100 if total_size else 100.0
173-
except Exception:
174-
percent, downloaded, total_size = 0.0, block_num * block_size, 0
175-
if percent - last_reported >= 20 or percent >= 100:
176-
logger.info(
177-
"Downloaded: %d/%d bytes (%.2f%%)", downloaded, total_size, percent
178-
)
179-
last_reported = percent
180-
181-
return report_progress
182-
183-
184162
def _extract_archive(
185163
url: str, archive_path: pathlib.Path, content_dir: str, dst_folder: pathlib.Path
186164
):

0 commit comments

Comments
 (0)