Instructions to use HandEdit/HandEdit-LoRA with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use HandEdit/HandEdit-LoRA with PEFT:
Task type is invalid.
- Notebooks
- Google Colab
- Kaggle
| #!/usr/bin/env python3 | |
| """Verify local sanitized LoRA files against weights_manifest.json.""" | |
| from __future__ import annotations | |
| import argparse | |
| import hashlib | |
| import json | |
| from pathlib import Path | |
| def sha256(path: Path) -> str: | |
| digest = hashlib.sha256() | |
| with path.open("rb") as handle: | |
| for chunk in iter(lambda: handle.read(8 * 1024 * 1024), b""): | |
| digest.update(chunk) | |
| return digest.hexdigest() | |
| def main() -> None: | |
| parser = argparse.ArgumentParser(description="Verify HandEdit LoRA checkpoints.") | |
| parser.add_argument( | |
| "--root", | |
| type=Path, | |
| default=Path("."), | |
| help="Repository root containing weights_manifest.json and checkpoints/.", | |
| ) | |
| args = parser.parse_args() | |
| root = args.root.expanduser().resolve() | |
| manifest = json.loads( | |
| (root / "weights_manifest.json").read_text(encoding="utf-8") | |
| ) | |
| failures = [] | |
| for adapter in manifest["adapters"].values(): | |
| for item in adapter["files"]: | |
| path = root / item["path"] | |
| if not path.is_file(): | |
| failures.append(f"missing: {item['path']}") | |
| continue | |
| if path.stat().st_size != item["size_bytes"]: | |
| failures.append(f"size mismatch: {item['path']}") | |
| continue | |
| if sha256(path) != item["sha256"]: | |
| failures.append(f"SHA-256 mismatch: {item['path']}") | |
| continue | |
| print(f"[OK] {item['path']}") | |
| if failures: | |
| raise SystemExit("\n".join(failures)) | |
| print("[DONE] All sanitized LoRA files passed verification.") | |
| if __name__ == "__main__": | |
| main() | |