File size: 1,841 Bytes
a99edfc
 
 
 
 
 
deb589d
 
 
 
 
a99edfc
 
 
deb589d
a99edfc
 
 
 
 
 
 
 
 
 
 
 
deb589d
 
a99edfc
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
"""Assemble a local release directory. Deliberately has no network/upload code."""
import hashlib
import json
import shutil
from pathlib import Path

def file_sha256(path):
    with path.open("rb") as source:
        return hashlib.file_digest(source, "sha256").hexdigest()


root = Path(__file__).resolve().parents[1]
destination = root / "release" / "notnotsamuel" / "LFM2.5-350M-RLCD"
destination.mkdir(parents=True, exist_ok=True)
files = [root / f for f in ["README.md", "LICENSE", "LICENSE-CODE", "requirements.txt", "modal_benchmark.py", ".gitignore", "BASE_MODEL_MANIFEST.json", "model.safetensors", "config.json", "generation_config.json", "tokenizer.json", "tokenizer_config.json", "chat_template.jinja"]]
for directory in ["rlcd", "tests", "scripts", "docs"]:
    files.extend(p for p in (root / directory).rglob("*") if p.is_file() and "__pycache__" not in p.parts)
files.extend((root / "results").glob("*.json"))
files.extend(root / "results" / f for f in ["REPORT.md", "local-tests.log", "environment-macos.txt"])
files.extend((root / "results" / "exploratory").glob("*.json"))
for source in files:
    relative = source.relative_to(root)
    target = destination / relative
    target.parent.mkdir(parents=True, exist_ok=True)
    shutil.copy2(source, target)
manifest = {"target_repository": "notnotsamuel/LFM2.5-350M-RLCD", "status": "release",
            "base_model": "LiquidAI/LFM2.5-350M", "base_revision": "9e6c6ccf47cd318696e137d381a7ded8fe4df09f",
            "contains_weights": True, "weights_modified": False, "training_performed": False,
            "files_sha256": {str(p.relative_to(root)):file_sha256(p) for p in sorted(files)}}
(destination / "RELEASE_MANIFEST.json").write_text(json.dumps(manifest, indent=2) + "\n")
print(destination)
print(f"Prepared {len(files)} files; no network operation performed.")