probablybots
commited on
Commit
•
f6e250e
1
Parent(s):
5c5bb95
Update README.md
Browse files
README.md
CHANGED
@@ -45,8 +45,8 @@ mgen test --model SequenceClassification --model.backbone aido_rna_1b600m --data
|
|
45 |
```python
|
46 |
from modelgenerator.tasks import Embed
|
47 |
model = Embed.from_config({"model.backbone": "aido_rna_1b600m"}).eval()
|
48 |
-
|
49 |
-
embedding = model(
|
50 |
print(embedding.shape)
|
51 |
print(embedding)
|
52 |
```
|
@@ -55,8 +55,8 @@ print(embedding)
|
|
55 |
import torch
|
56 |
from modelgenerator.tasks import SequenceClassification
|
57 |
model = SequenceClassification.from_config({"model.backbone": "aido_rna_1b600m", "model.n_classes": 2}).eval()
|
58 |
-
|
59 |
-
logits = model(
|
60 |
print(logits)
|
61 |
print(torch.argmax(logits, dim=-1))
|
62 |
```
|
@@ -65,8 +65,8 @@ print(torch.argmax(logits, dim=-1))
|
|
65 |
import torch
|
66 |
from modelgenerator.tasks import TokenClassification
|
67 |
model = TokenClassification.from_config({"model.backbone": "aido_rna_1b600m", "model.n_classes": 3}).eval()
|
68 |
-
|
69 |
-
logits = model(
|
70 |
print(logits)
|
71 |
print(torch.argmax(logits, dim=-1))
|
72 |
```
|
@@ -74,8 +74,8 @@ print(torch.argmax(logits, dim=-1))
|
|
74 |
```python
|
75 |
from modelgenerator.tasks import SequenceRegression
|
76 |
model = SequenceRegression.from_config({"model.backbone": "aido_rna_1b600m"}).eval()
|
77 |
-
|
78 |
-
logits = model(
|
79 |
print(logits)
|
80 |
```
|
81 |
|
@@ -83,8 +83,8 @@ print(logits)
|
|
83 |
```python
|
84 |
from genbio_finetune.tasks import Embed
|
85 |
model = Embed.from_config({"model.backbone": "aido_rna_1b600m"}).eval()
|
86 |
-
|
87 |
-
embedding = model(
|
88 |
print(embedding.shape)
|
89 |
print(embedding)
|
90 |
```
|
|
|
45 |
```python
|
46 |
from modelgenerator.tasks import Embed
|
47 |
model = Embed.from_config({"model.backbone": "aido_rna_1b600m"}).eval()
|
48 |
+
transformed_batch = model.transform({"sequences": ["ACGT", "AGCT"]})
|
49 |
+
embedding = model(transformed_batch)
|
50 |
print(embedding.shape)
|
51 |
print(embedding)
|
52 |
```
|
|
|
55 |
import torch
|
56 |
from modelgenerator.tasks import SequenceClassification
|
57 |
model = SequenceClassification.from_config({"model.backbone": "aido_rna_1b600m", "model.n_classes": 2}).eval()
|
58 |
+
transformed_batch = model.transform({"sequences": ["ACGT", "AGCT"]})
|
59 |
+
logits = model(transformed_batch)
|
60 |
print(logits)
|
61 |
print(torch.argmax(logits, dim=-1))
|
62 |
```
|
|
|
65 |
import torch
|
66 |
from modelgenerator.tasks import TokenClassification
|
67 |
model = TokenClassification.from_config({"model.backbone": "aido_rna_1b600m", "model.n_classes": 3}).eval()
|
68 |
+
transformed_batch = model.transform({"sequences": ["ACGT", "AGCT"]})
|
69 |
+
logits = model(transformed_batch)
|
70 |
print(logits)
|
71 |
print(torch.argmax(logits, dim=-1))
|
72 |
```
|
|
|
74 |
```python
|
75 |
from modelgenerator.tasks import SequenceRegression
|
76 |
model = SequenceRegression.from_config({"model.backbone": "aido_rna_1b600m"}).eval()
|
77 |
+
transformed_batch = model.transform({"sequences": ["ACGT", "AGCT"]})
|
78 |
+
logits = model(transformed_batch)
|
79 |
print(logits)
|
80 |
```
|
81 |
|
|
|
83 |
```python
|
84 |
from genbio_finetune.tasks import Embed
|
85 |
model = Embed.from_config({"model.backbone": "aido_rna_1b600m"}).eval()
|
86 |
+
transformed_batch = model.transform({"sequences": ["ACGT", "ACGT"]})
|
87 |
+
embedding = model(transformed_batch)
|
88 |
print(embedding.shape)
|
89 |
print(embedding)
|
90 |
```
|