DianLiI commited on
Commit
7d4c082
1 Parent(s): ad5328d

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-cds
6
  ---
7
- 5-fold cross-validation LoRA fine-tuned checkpoints for protein abundance prediction (hsapiens).
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
  base_model:
5
  - genbio-ai/rnafm-1.6b-cds
6
  ---
7
+ 5-fold cross-validation LoRA fine-tuned checkpoints for protein abundance prediction (hsapiens).
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-cds-protein-abundance-hsapiens-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)