Views
No views yet
.ckpt and the original TOML config so you can reconstruct the model as trained.model.ckpt: PyTorch Lightning checkpoint for TrainingModelconfig.toml: training/model config (same schema as this repo's configs/*.toml)contempro-mf-2020-ordered-encdec-medium:best1import torch
2from huggingface_hub import hf_hub_download
3
4from config import from_toml
5from model import TrainingModel, get_model_cls
6
7repo_id = "mmtf/stargo-mf"
8ckpt_path = hf_hub_download(repo_id, "model.ckpt")
9cfg_path = hf_hub_download(repo_id, "config.toml")
10
11cfg = from_toml(cfg_path)
12
13module = TrainingModel.load_from_checkpoint(
14 ckpt_path,
15 model=get_model_cls(cfg.model.name)(cfg.model),
16 training_config=cfg.train,
17)
18module = module.to("cuda" if torch.cuda.is_available() else "cpu")
19module.eval()