DianLiI commited on
Commit
d1eebfb
·
verified ·
1 Parent(s): 5123689

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +23 -1
README.md CHANGED
@@ -4,4 +4,26 @@ datasets:
4
  base_model:
5
  - genbio-ai/rnafm-1.6b
6
  ---
7
- 10-fold cross-validation fully fine-tuned checkpoints for mRNA expression level prediction (pc3).
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
  base_model:
5
  - genbio-ai/rnafm-1.6b
6
  ---
7
+ 10-fold cross-validation fully fine-tuned checkpoints for mRNA expression level prediction (pc3).
8
+
9
+ ## How to Use
10
+ ### Download model
11
+ ```python
12
+ from huggingface_hub import snapshot_download
13
+ from pathlib import Path
14
+
15
+ model_name = "genbio-ai/rnafm-1.6b-mrna-expression-level-pc3-ckpt"
16
+ genbio_models_path = Path.home().joinpath('genbio_models', model_name)
17
+ genbio_models_path.mkdir(parents=True, exist_ok=True)
18
+ snapshot_download(repo_id=model_name, local_dir=genbio_models_path)
19
+ ```
20
+ ### Load model for inference
21
+ ```python
22
+ from genbio_finetune.tasks import SequenceRegression
23
+
24
+ ckpt_path = genbio_models_path.joinpath('fold0', 'model.ckpt')
25
+ model = SequenceRegression.load_from_checkpoint(ckpt_path, strict_loading=False).eval()
26
+
27
+ collated_batch = model.collate({"sequences": ["ACGT", "AGCT"]})
28
+ logits = model(collated_batch)
29
+ print(logits)