Caleb Ellington commited on
Commit
beaed13
·
1 Parent(s): 49d76bc

update with major refactor

Browse files
Files changed (2) hide show
  1. README.md +2 -2
  2. config.yaml +6 -6
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 genbio_finetune.tasks import TokenClassification
24
 
25
  ckpt_path = genbio_models_path.joinpath('model.ckpt')
26
  model = TokenClassification.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))
 
20
  ### Load model for inference
21
  ```python
22
  import torch
23
+ from modelgenerator.tasks import TokenClassification
24
 
25
  ckpt_path = genbio_models_path.joinpath('model.ckpt')
26
  model = TokenClassification.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
@@ -77,7 +77,7 @@ trainer:
77
  log_weight_decay: false
78
  - class_path: lightning.pytorch.callbacks.ModelCheckpoint
79
  init_args:
80
- dirpath: genbio_finetune/logs/xtrimo_benchmark_gbft_reproduction/ssp_proteinmoe_16B
81
  filename: best_val:{epoch}-{val_accuracy:.3f}
82
  monitor: val_accuracy
83
  verbose: false
@@ -138,10 +138,10 @@ trainer:
138
  reload_dataloaders_every_n_epochs: 0
139
  default_root_dir: null
140
  model:
141
- class_path: genbio_finetune.tasks.TokenClassification
142
  init_args:
143
  adapter:
144
- class_path: genbio_finetune.models.MLPAdapter
145
  init_args:
146
  hidden_sizes:
147
  - 128
@@ -149,7 +149,7 @@ model:
149
  dropout: 0.1
150
  dropout_in_middle: true
151
  backbone:
152
- class_path: genbio_finetune.models.proteinfm
153
  init_args:
154
  from_scratch: false
155
  max_length: 512
@@ -187,7 +187,7 @@ model:
187
  differentiable: false
188
  fused: null
189
  lr_scheduler:
190
- class_path: genbio_finetune.lr_schedulers.CosineWithWarmup
191
  init_args:
192
  warmup_ratio: 0.05
193
  num_warmup_steps: null
@@ -197,7 +197,7 @@ model:
197
  strict_loading: true
198
  reset_optimizer_states: false
199
  data:
200
- class_path: genbio_finetune.data.SspQ3
201
  init_args:
202
  path: biomap-research/ssp_q3
203
  batch_size: 1
 
77
  log_weight_decay: false
78
  - class_path: lightning.pytorch.callbacks.ModelCheckpoint
79
  init_args:
80
+ dirpath: modelgenerator/logs/xtrimo_benchmark_gbft_reproduction/ssp_proteinmoe_16B
81
  filename: best_val:{epoch}-{val_accuracy:.3f}
82
  monitor: val_accuracy
83
  verbose: false
 
138
  reload_dataloaders_every_n_epochs: 0
139
  default_root_dir: null
140
  model:
141
+ class_path: modelgenerator.tasks.TokenClassification
142
  init_args:
143
  adapter:
144
+ class_path: modelgenerator.adapters.MLPAdapter
145
  init_args:
146
  hidden_sizes:
147
  - 128
 
149
  dropout: 0.1
150
  dropout_in_middle: true
151
  backbone:
152
+ class_path: modelgenerator.backbones.proteinfm
153
  init_args:
154
  from_scratch: false
155
  max_length: 512
 
187
  differentiable: false
188
  fused: null
189
  lr_scheduler:
190
+ class_path: modelgenerator.lr_schedulers.CosineWithWarmup
191
  init_args:
192
  warmup_ratio: 0.05
193
  num_warmup_steps: null
 
197
  strict_loading: true
198
  reset_optimizer_states: false
199
  data:
200
+ class_path: modelgenerator.data.SspQ3
201
  init_args:
202
  path: biomap-research/ssp_q3
203
  batch_size: 1