Caleb Ellington
commited on
Commit
•
b7a40ba
1
Parent(s):
129692e
update with major refactor
Browse files- README.md +2 -2
- config.yaml +8 -8
README.md
CHANGED
@@ -20,12 +20,12 @@ snapshot_download(repo_id=model_name, local_dir=genbio_models_path)
|
|
20 |
### Load model for inference
|
21 |
```python
|
22 |
import torch
|
23 |
-
from
|
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.
|
29 |
logits = model(collated_batch)
|
30 |
print(logits)
|
31 |
print(torch.argmax(logits, dim=-1))
|
|
|
20 |
### Load model for inference
|
21 |
```python
|
22 |
import torch
|
23 |
+
from modelgenerator.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.transform({"sequences": ["ACGT", "AGCT"]})
|
29 |
logits = model(collated_batch)
|
30 |
print(logits)
|
31 |
print(torch.argmax(logits, dim=-1))
|
config.yaml
CHANGED
@@ -37,7 +37,7 @@ trainer:
|
|
37 |
class_path: lightning.pytorch.loggers.WandbLogger
|
38 |
init_args:
|
39 |
name: csp_acceptor_rnafm_1.6B
|
40 |
-
save_dir:
|
41 |
version: null
|
42 |
offline: false
|
43 |
dir: null
|
@@ -75,7 +75,7 @@ trainer:
|
|
75 |
log_weight_decay: false
|
76 |
- class_path: lightning.pytorch.callbacks.ModelCheckpoint
|
77 |
init_args:
|
78 |
-
dirpath:
|
79 |
filename: best_val:{epoch}-{val_f1:.3f}
|
80 |
monitor: val_f1
|
81 |
verbose: false
|
@@ -134,12 +134,12 @@ trainer:
|
|
134 |
plugins: null
|
135 |
sync_batchnorm: false
|
136 |
reload_dataloaders_every_n_epochs: 0
|
137 |
-
default_root_dir:
|
138 |
model:
|
139 |
-
class_path:
|
140 |
init_args:
|
141 |
backbone:
|
142 |
-
class_path:
|
143 |
init_args:
|
144 |
from_scratch: false
|
145 |
max_length: 1024
|
@@ -156,7 +156,7 @@ model:
|
|
156 |
attention_probs_dropout_prob: 0.1
|
157 |
model_init_args: null
|
158 |
adapter:
|
159 |
-
class_path:
|
160 |
init_args:
|
161 |
pooling: cls_pooling
|
162 |
hidden_sizes:
|
@@ -183,7 +183,7 @@ model:
|
|
183 |
differentiable: false
|
184 |
fused: null
|
185 |
lr_scheduler:
|
186 |
-
class_path:
|
187 |
init_args:
|
188 |
warmup_ratio: 0.01
|
189 |
num_warmup_steps: null
|
@@ -193,7 +193,7 @@ model:
|
|
193 |
strict_loading: true
|
194 |
reset_optimizer_states: false
|
195 |
data:
|
196 |
-
class_path:
|
197 |
init_args:
|
198 |
path: genbio-ai/rna-downstream-tasks
|
199 |
config_name: splice_site_acceptor
|
|
|
37 |
class_path: lightning.pytorch.loggers.WandbLogger
|
38 |
init_args:
|
39 |
name: csp_acceptor_rnafm_1.6B
|
40 |
+
save_dir: modelgenerator/logs
|
41 |
version: null
|
42 |
offline: false
|
43 |
dir: null
|
|
|
75 |
log_weight_decay: false
|
76 |
- class_path: lightning.pytorch.callbacks.ModelCheckpoint
|
77 |
init_args:
|
78 |
+
dirpath: modelgenerator/logs/rna_tasks/csp_acceptor_rnafm_1.6B
|
79 |
filename: best_val:{epoch}-{val_f1:.3f}
|
80 |
monitor: val_f1
|
81 |
verbose: false
|
|
|
134 |
plugins: null
|
135 |
sync_batchnorm: false
|
136 |
reload_dataloaders_every_n_epochs: 0
|
137 |
+
default_root_dir: modelgenerator/logs
|
138 |
model:
|
139 |
+
class_path: modelgenerator.tasks.SequenceClassification
|
140 |
init_args:
|
141 |
backbone:
|
142 |
+
class_path: modelgenerator.backbones.rnafm
|
143 |
init_args:
|
144 |
from_scratch: false
|
145 |
max_length: 1024
|
|
|
156 |
attention_probs_dropout_prob: 0.1
|
157 |
model_init_args: null
|
158 |
adapter:
|
159 |
+
class_path: modelgenerator.adapters.MLPPoolAdapter
|
160 |
init_args:
|
161 |
pooling: cls_pooling
|
162 |
hidden_sizes:
|
|
|
183 |
differentiable: false
|
184 |
fused: null
|
185 |
lr_scheduler:
|
186 |
+
class_path: modelgenerator.lr_schedulers.LinearWithWarmup
|
187 |
init_args:
|
188 |
warmup_ratio: 0.01
|
189 |
num_warmup_steps: null
|
|
|
193 |
strict_loading: true
|
194 |
reset_optimizer_states: false
|
195 |
data:
|
196 |
+
class_path: modelgenerator.data.SpliceSitePrediction
|
197 |
init_args:
|
198 |
path: genbio-ai/rna-downstream-tasks
|
199 |
config_name: splice_site_acceptor
|