Views
No views yet
1from huggingface_hub import snapshot_download
2from pathlib import Path
3
4model_name = "genbio-ai/GB.RNA-1.6B-csp-acceptor"
5genbio_models_path = Path.home().joinpath('genbio_models', model_name)
6genbio_models_path.mkdir(parents=True, exist_ok=True)
7snapshot_download(repo_id=model_name, local_dir=genbio_models_path)1import torch
2from modelgenerator.tasks import SequenceClassification
3
4ckpt_path = genbio_models_path.joinpath('model.ckpt')
5model = SequenceClassification.load_from_checkpoint(ckpt_path, strict_loading=False).eval()
6
7collated_batch = model.transform({"sequences": ["ACGT", "AGCT"]})
8logits = model(collated_batch)
9print(logits)
10print(torch.argmax(logits, dim=-1))