MCPcopy Create free account
hub / github.com/AnswerDotAI/gpu.cpp / report_progress

Function report_progress

setup.py:27–34  ·  view source on GitHub ↗
(block_num, block_size, total_size)

Source from the content-addressed store, hash-verified

25 total_truncated = 0 # only print download progress every 2MB to avoid spamming logs
26
27 def report_progress(block_num, block_size, total_size):
28 nonlocal total_downloaded
29 nonlocal total_truncated
30 total_downloaded += block_size
31 if total_downloaded // (1024 * 1024) > total_truncated:
32 total_truncated = total_downloaded // (1024 * 1024)
33 if total_truncated % 2 == 0:
34 print(f"\rDownloaded {total_downloaded // (1024 * 1024)} MB", end="")
35
36 try:
37 ssl._create_default_https_context = ssl._create_stdlib_context

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected