Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
## How to Use
|
2 |
+
### Download model
|
3 |
+
```python
|
4 |
+
from huggingface_hub import snapshot_download
|
5 |
+
from pathlib import Path
|
6 |
+
|
7 |
+
model_name = "genbio-ai/proteinfm-16b-dms-indels-FECA_ECOLI_Tsuboyama_2023_2D1U_indels-ckpt"
|
8 |
+
genbio_models_path = Path.home().joinpath('genbio_models', model_name)
|
9 |
+
genbio_models_path.mkdir(parents=True, exist_ok=True)
|
10 |
+
snapshot_download(repo_id=model_name, local_dir=genbio_models_path)
|
11 |
+
```
|
12 |
+
### Load model for inference
|
13 |
+
```python
|
14 |
+
from genbio_finetune.tasks import SequenceRegression
|
15 |
+
|
16 |
+
ckpt_path = genbio_models_path.joinpath('fold0', 'model.ckpt')
|
17 |
+
model = SequenceRegression.load_from_checkpoint(ckpt_path, strict_loading=False).eval()
|
18 |
+
|
19 |
+
collated_batch = model.collate({"sequences": ["ACGT", "AGCT"]})
|
20 |
+
logits = model(collated_batch)
|
21 |
+
print(logits)
|