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

Function get_ckpt_path

vtp/utils/lpips.py:48–58  ·  view source on GitHub ↗
(name, root=None, check=False)

Source from the content-addressed store, hash-verified

46
47
48def get_ckpt_path(name, root=None, check=False):
49 assert name in URL_MAP
50 if root is None:
51 root = get_cache_dir()
52 path = os.path.join(root, CKPT_MAP[name])
53 if not os.path.exists(path) or (check and not md5_hash(path) == MD5_MAP[name]):
54 print(f"Downloading {name} model from {URL_MAP[name]} to {path}")
55 download(URL_MAP[name], path)
56 md5 = md5_hash(path)
57 assert md5 == MD5_MAP[name], md5
58 return path
59
60
61class LPIPS(nn.Module):

Callers 1

load_from_pretrainedMethod · 0.85

Calls 3

get_cache_dirFunction · 0.85
md5_hashFunction · 0.85
downloadFunction · 0.85

Tested by

no test coverage detected