MCPcopy Create free account
hub / github.com/PaddlePaddle/FastDeploy / extract_tar

Function extract_tar

fastdeploy/utils.py:428–439  ·  view source on GitHub ↗

Extract tar file with progress tracking

(tar_path, output_dir)

Source from the content-addressed store, hash-verified

426
427
428def extract_tar(tar_path, output_dir):
429 """Extract tar file with progress tracking"""
430 try:
431 with tarfile.open(tar_path) as tar:
432 members = tar.getmembers()
433 with tqdm(total=len(members), desc="Extracting files") as pbar:
434 for member in members:
435 tar.extract(member, path=output_dir)
436 pbar.update(1)
437 print(f"Successfully extracted to: {output_dir}")
438 except Exception as e:
439 raise RuntimeError(f"Extraction failed: {e!s}")
440
441
442def set_random_seed(seed: int) -> None:

Callers 1

download_modelFunction · 0.85

Calls 2

printFunction · 0.85
updateMethod · 0.45

Tested by

no test coverage detected