Team Ai
Modelpublic

notnotsamuel/LFM2.5-350M-RLCD

sourceHugging Faceotherupdated 25d agoView on Hugging Face
25likes977downloads
prepare_release.py33 linesDownload Raw Back to scripts
1"""Assemble a local release directory. Deliberately has no network/upload code."""2import hashlib3import json4import shutil5from pathlib import Path6 7def file_sha256(path):8    with path.open("rb") as source:9        return hashlib.file_digest(source, "sha256").hexdigest()10 11 12root = Path(__file__).resolve().parents[1]13destination = root / "release" / "notnotsamuel" / "LFM2.5-350M-RLCD"14destination.mkdir(parents=True, exist_ok=True)15files = [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"]]16for directory in ["rlcd", "tests", "scripts", "docs"]:17    files.extend(p for p in (root / directory).rglob("*") if p.is_file() and "__pycache__" not in p.parts)18files.extend((root / "results").glob("*.json"))19files.extend(root / "results" / f for f in ["REPORT.md", "local-tests.log", "environment-macos.txt"])20files.extend((root / "results" / "exploratory").glob("*.json"))21for source in files:22    relative = source.relative_to(root)23    target = destination / relative24    target.parent.mkdir(parents=True, exist_ok=True)25    shutil.copy2(source, target)26manifest = {"target_repository": "notnotsamuel/LFM2.5-350M-RLCD", "status": "release",27            "base_model": "LiquidAI/LFM2.5-350M", "base_revision": "9e6c6ccf47cd318696e137d381a7ded8fe4df09f",28            "contains_weights": True, "weights_modified": False, "training_performed": False,29            "files_sha256": {str(p.relative_to(root)):file_sha256(p) for p in sorted(files)}}30(destination / "RELEASE_MANIFEST.json").write_text(json.dumps(manifest, indent=2) + "\n")31print(destination)32print(f"Prepared {len(files)} files; no network operation performed.")33