Update README.md
Browse files
README.md
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
#### Embedding
|
4 |
```python
|
5 |
from genbio_finetune.tasks import Embed
|
6 |
-
model = Embed.from_config({"model.backbone": "
|
7 |
collated_batch = model.collate({"sequences": ["ACGT", "AGCT"]})
|
8 |
embedding = model(collated_batch)
|
9 |
print(embedding.shape)
|
@@ -13,7 +13,7 @@ print(embedding)
|
|
13 |
```python
|
14 |
import torch
|
15 |
from genbio_finetune.tasks import SequenceClassification
|
16 |
-
model = SequenceClassification.from_config({"model.backbone": "
|
17 |
collated_batch = model.collate({"sequences": ["ACGT", "AGCT"]})
|
18 |
logits = model(collated_batch)
|
19 |
print(logits)
|
@@ -23,7 +23,7 @@ print(torch.argmax(logits, dim=-1))
|
|
23 |
```python
|
24 |
import torch
|
25 |
from genbio_finetune.tasks import TokenClassification
|
26 |
-
model = TokenClassification.from_config({"model.backbone": "
|
27 |
collated_batch = model.collate({"sequences": ["ACGT", "AGCT"]})
|
28 |
logits = model(collated_batch)
|
29 |
print(logits)
|
@@ -32,14 +32,14 @@ print(torch.argmax(logits, dim=-1))
|
|
32 |
#### Regression
|
33 |
```python
|
34 |
from genbio_finetune.tasks import SequenceRegression
|
35 |
-
model = SequenceRegression.from_config({"model.backbone": "
|
36 |
collated_batch = model.collate({"sequences": ["ACGT", "AGCT"]})
|
37 |
logits = model(collated_batch)
|
38 |
print(logits)
|
39 |
```
|
40 |
#### Or use our one-liner CLI to finetune or evaluate any of the above!
|
41 |
```
|
42 |
-
gbft fit --model SequenceClassification --model.backbone
|
43 |
-
gbft test --model SequenceClassification --model.backbone
|
44 |
```
|
45 |
For more information, visit: [Model Generator](https://github.com/genbio-ai/modelgenerator)
|
|
|
3 |
#### Embedding
|
4 |
```python
|
5 |
from genbio_finetune.tasks import Embed
|
6 |
+
model = Embed.from_config({"model.backbone": "dna300m"}).eval()
|
7 |
collated_batch = model.collate({"sequences": ["ACGT", "AGCT"]})
|
8 |
embedding = model(collated_batch)
|
9 |
print(embedding.shape)
|
|
|
13 |
```python
|
14 |
import torch
|
15 |
from genbio_finetune.tasks import SequenceClassification
|
16 |
+
model = SequenceClassification.from_config({"model.backbone": "dna300m", "model.n_classes": 2}).eval()
|
17 |
collated_batch = model.collate({"sequences": ["ACGT", "AGCT"]})
|
18 |
logits = model(collated_batch)
|
19 |
print(logits)
|
|
|
23 |
```python
|
24 |
import torch
|
25 |
from genbio_finetune.tasks import TokenClassification
|
26 |
+
model = TokenClassification.from_config({"model.backbone": "dna300m", "model.n_classes": 3}).eval()
|
27 |
collated_batch = model.collate({"sequences": ["ACGT", "AGCT"]})
|
28 |
logits = model(collated_batch)
|
29 |
print(logits)
|
|
|
32 |
#### Regression
|
33 |
```python
|
34 |
from genbio_finetune.tasks import SequenceRegression
|
35 |
+
model = SequenceRegression.from_config({"model.backbone": "dna300m"}).eval()
|
36 |
collated_batch = model.collate({"sequences": ["ACGT", "AGCT"]})
|
37 |
logits = model(collated_batch)
|
38 |
print(logits)
|
39 |
```
|
40 |
#### Or use our one-liner CLI to finetune or evaluate any of the above!
|
41 |
```
|
42 |
+
gbft fit --model SequenceClassification --model.backbone dna300m --data SequenceClassification --data.path <hf_or_local_path_to_your_dataset>
|
43 |
+
gbft test --model SequenceClassification --model.backbone dna300m --data SequenceClassification --data.path <hf_or_local_path_to_your_dataset>
|
44 |
```
|
45 |
For more information, visit: [Model Generator](https://github.com/genbio-ai/modelgenerator)
|