MCPcopy Create free account
hub / github.com/MiniMax-AI/VTP / download

Function download

vtp/utils/lpips.py:30–39  ·  view source on GitHub ↗
(url, local_path, chunk_size=1024)

Source from the content-addressed store, hash-verified

28
29
30def download(url, local_path, chunk_size=1024):
31 os.makedirs(os.path.split(local_path)[0], exist_ok=True)
32 with requests.get(url, stream=True) as r:
33 total_size = int(r.headers.get("content-length", 0))
34 with tqdm(total=total_size, unit="B", unit_scale=True, desc="Downloading LPIPS weights") as pbar:
35 with open(local_path, "wb") as f:
36 for data in r.iter_content(chunk_size=chunk_size):
37 if data:
38 f.write(data)
39 pbar.update(chunk_size)
40
41
42def md5_hash(path):

Callers 1

get_ckpt_pathFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected