MCPcopy
hub / github.com/NVIDIA/TensorRT-LLM / compress

Function compress

scripts/package_trt_llm.py:72–88  ·  view source on GitHub ↗
(tgt_pkg_name: Path, src_dir: Path)

Source from the content-addressed store, hash-verified

70
71
72def compress(tgt_pkg_name: Path, src_dir: Path) -> None:
73 logging.info(f"Creating compressed package {tgt_pkg_name} from {src_dir}")
74 # Create the tar package
75 if tgt_pkg_name.suffix == ".zip":
76 if platform.system() == "Windows":
77 raise NotImplementedError("Windows zip path not implemented.")
78 else:
79 command = ("(cd", str(src_dir.parent), "&&", "zip", "-r", "-",
80 src_dir.name, ")")
81 command = command + (">", str(tgt_pkg_name))
82 # command = ('zip', '-r', str(tgt_pkg_name), str(src_dir))
83 else:
84 command = ('tar', '-C', str(src_dir.parent), '-czvf', str(tgt_pkg_name),
85 src_dir.name)
86 command = " ".join(command)
87 logging.debug(f"Executing {command}")
88 subprocess.run(command, check=True, shell=True)
89
90
91LibInfo = namedtuple(

Callers 1

mainFunction · 0.85

Calls 3

infoMethod · 0.45
debugMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected