MCPcopy Create free account
hub / github.com/Tencent/MimicMotion / download_weights

Function download_weights

predict.py:27–43  ·  view source on GitHub ↗
(url: str, dest: str)

Source from the content-addressed store, hash-verified

25
26
27def download_weights(url: str, dest: str) -> None:
28 # NOTE WHEN YOU EXTRACT SPECIFY THE PARENT FOLDER
29 start = time.time()
30 print("[!] Initiating download from URL: ", url)
31 print("[~] Destination path: ", dest)
32 if ".tar" in dest:
33 dest = os.path.dirname(dest)
34 command = ["pget", "-vf" + ("x" if ".tar" in url else ""), url, dest]
35 try:
36 print(f"[~] Running command: {' '.join(command)}")
37 subprocess.check_call(command, close_fds=False)
38 except subprocess.CalledProcessError as e:
39 print(
40 f"[ERROR] Failed to download weights. Command '{' '.join(e.cmd)}' returned non-zero exit status {e.returncode}."
41 )
42 raise
43 print("[+] Download completed in: ", time.time() - start, "seconds")
44
45
46class Predictor(BasePredictor):

Callers 1

setupMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected