Update README.md
Browse files
README.md
CHANGED
@@ -4,4 +4,29 @@ datasets:
|
|
4 |
base_model:
|
5 |
- genbio-ai/rnafm-1.6b
|
6 |
---
|
7 |
-
LoRA fine-tuned checkpoint for splice site prediction.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
base_model:
|
5 |
- genbio-ai/rnafm-1.6b
|
6 |
---
|
7 |
+
LoRA fine-tuned checkpoint for splice site prediction.
|
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-csp-acceptor-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 |
+
import torch
|
23 |
+
from genbio_finetune.tasks import SequenceClassification
|
24 |
+
|
25 |
+
ckpt_path = genbio_models_path.joinpath('model.ckpt')
|
26 |
+
model = SequenceClassification.load_from_checkpoint(ckpt_path, strict_loading=False).eval()
|
27 |
+
|
28 |
+
collated_batch = model.collate({"sequences": ["ACGT", "AGCT"]})
|
29 |
+
logits = model(collated_batch)
|
30 |
+
print(logits)
|
31 |
+
print(torch.argmax(logits, dim=-1))
|
32 |
+
```
|