Download code/scripts/package_submission.py from CollinMa/nextgpt-chapter6-report: direct link, hf CLI and curl.
- Browser
- Download file 702 Bytes
-
https://huggingface.co/spaces/CollinMa/nextgpt-chapter6-report/resolve/main/code/scripts/package_submission.py
- Command line
-
hf download hf://spaces/CollinMa/nextgpt-chapter6-report/code/scripts/package_submission.py
-
curl -L -o package_submission.py https://huggingface.co/spaces/CollinMa/nextgpt-chapter6-report/resolve/main/code/scripts/package_submission.py
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)") | |