File size: 666 Bytes
7e7a152 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | """Local checkpoints; trained models are registered by their evaluation entry points."""
import json
from pathlib import Path
R = Path(__file__).resolve().parents[2]
MODELS = json.loads((R / 'configs/models.json').read_text())
for profile in MODELS.values():
path = Path(profile['path']).expanduser()
profile['path'] = str(path if path.is_absolute() else R / path)
def ready(name):
profile = MODELS[name]
if 'parent' in profile:
path = Path(profile['parent'])
return (path/'complete.json').is_file() and (path/'final.safetensors').is_file() and (path/'final.safetensors').stat().st_size > 0
return Path(profile['path']).is_dir()
|