probablybots commited on
Commit
2b47b8c
1 Parent(s): 2457dc7

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +10 -10
README.md CHANGED
@@ -21,8 +21,8 @@ mgen test --model SequenceClassification --model.backbone aido_rna_300m_mars --d
21
  ```python
22
  from modelgenerator.tasks import Embed
23
  model = Embed.from_config({"model.backbone": "aido_rna_300m_mars"}).eval()
24
- collated_batch = model.collate({"sequences": ["ACGT", "AGCT"]})
25
- embedding = model(collated_batch)
26
  print(embedding.shape)
27
  print(embedding)
28
  ```
@@ -31,8 +31,8 @@ print(embedding)
31
  import torch
32
  from modelgenerator.tasks import SequenceClassification
33
  model = SequenceClassification.from_config({"model.backbone": "aido_rna_300m_mars", "model.n_classes": 2}).eval()
34
- collated_batch = model.collate({"sequences": ["ACGT", "AGCT"]})
35
- logits = model(collated_batch)
36
  print(logits)
37
  print(torch.argmax(logits, dim=-1))
38
  ```
@@ -41,8 +41,8 @@ print(torch.argmax(logits, dim=-1))
41
  import torch
42
  from modelgenerator.tasks import TokenClassification
43
  model = TokenClassification.from_config({"model.backbone": "aido_rna_300m_mars", "model.n_classes": 3}).eval()
44
- collated_batch = model.collate({"sequences": ["ACGT", "AGCT"]})
45
- logits = model(collated_batch)
46
  print(logits)
47
  print(torch.argmax(logits, dim=-1))
48
  ```
@@ -50,8 +50,8 @@ print(torch.argmax(logits, dim=-1))
50
  ```python
51
  from modelgenerator.tasks import SequenceRegression
52
  model = SequenceRegression.from_config({"model.backbone": "aido_rna_300m_mars"}).eval()
53
- collated_batch = model.collate({"sequences": ["ACGT", "AGCT"]})
54
- logits = model(collated_batch)
55
  print(logits)
56
  ```
57
 
@@ -59,8 +59,8 @@ print(logits)
59
  ```python
60
  from genbio_finetune.tasks import Embed
61
  model = Embed.from_config({"model.backbone": "aido_rna_300m_mars"}).eval()
62
- collated_batch = model.collate({"sequences": ["ACGT", "ACGT"]})
63
- embedding = model(collated_batch)
64
  print(embedding.shape)
65
  print(embedding)
66
  ```
 
21
  ```python
22
  from modelgenerator.tasks import Embed
23
  model = Embed.from_config({"model.backbone": "aido_rna_300m_mars"}).eval()
24
+ transformed_batch = model.transform({"sequences": ["ACGT", "AGCT"]})
25
+ embedding = model(transformed_batch)
26
  print(embedding.shape)
27
  print(embedding)
28
  ```
 
31
  import torch
32
  from modelgenerator.tasks import SequenceClassification
33
  model = SequenceClassification.from_config({"model.backbone": "aido_rna_300m_mars", "model.n_classes": 2}).eval()
34
+ transformed_batch = model.transform({"sequences": ["ACGT", "AGCT"]})
35
+ logits = model(transformed_batch)
36
  print(logits)
37
  print(torch.argmax(logits, dim=-1))
38
  ```
 
41
  import torch
42
  from modelgenerator.tasks import TokenClassification
43
  model = TokenClassification.from_config({"model.backbone": "aido_rna_300m_mars", "model.n_classes": 3}).eval()
44
+ transformed_batch = model.transform({"sequences": ["ACGT", "AGCT"]})
45
+ logits = model(transformed_batch)
46
  print(logits)
47
  print(torch.argmax(logits, dim=-1))
48
  ```
 
50
  ```python
51
  from modelgenerator.tasks import SequenceRegression
52
  model = SequenceRegression.from_config({"model.backbone": "aido_rna_300m_mars"}).eval()
53
+ transformed_batch = model.transform({"sequences": ["ACGT", "AGCT"]})
54
+ logits = model(transformed_batch)
55
  print(logits)
56
  ```
57
 
 
59
  ```python
60
  from genbio_finetune.tasks import Embed
61
  model = Embed.from_config({"model.backbone": "aido_rna_300m_mars"}).eval()
62
+ transformed_batch = model.transform({"sequences": ["ACGT", "ACGT"]})
63
+ embedding = model(transformed_batch)
64
  print(embedding.shape)
65
  print(embedding)
66
  ```