nextgpt-chapter6-report / code /scripts /package_submission.py
CollinMa's picture
Publish NExT-GPT course code and actual execution records
15c46ce verified
Raw History Blame Contribute Delete
702 Bytes
"""Package the explicit source allowlist, excluding credentials and model weights."""
import argparse
import zipfile
from pathlib import Path
from publish_space import ROOT, source_files
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument("--output", default=str(ROOT.parent / "nextgpt-chapter6-submission.zip"))
args = parser.parse_args()
target = Path(args.output).resolve()
with zipfile.ZipFile(target, "w", compression=zipfile.ZIP_DEFLATED) as archive:
for file in source_files():
archive.write(file, "nextgpt-reproduction/" + file.relative_to(ROOT).as_posix())
print(f"Created {target} ({target.stat().st_size:,} bytes)")