gamedevelop's picture
Update chatcode/package.py
7752b17 verified
Raw History Blame Contribute Delete
842 Bytes
"""Package only source and configuration; no credentials, data, or old weights."""
from pathlib import Path
import zipfile
ROOT = Path(__file__).resolve().parent.parent
if __name__ == "__main__":
files = [ROOT / name for name in ["app.py", "chat.py", "LICENSE", "LICENSE-BASE-MODEL.txt"]]
files += [p for p in (ROOT / "chatcode").iterdir()
if p.is_file() and p.suffix in {".py", ".json", ".md", ".txt", ".ipynb"}]
(ROOT / "dist").mkdir(exist_ok=True)
destination = ROOT / "dist/pocketvision-chat-code-writing-source.zip"
with zipfile.ZipFile(destination, "w", compression=zipfile.ZIP_DEFLATED) as bundle:
for path in sorted(files):
bundle.write(path, path.relative_to(ROOT).as_posix())
print(f"Created {destination} ({destination.stat().st_size:,} bytes; source only, untrained)")