Commit
•
639e827
1
Parent(s):
a2b9bf5
Update README.md
Browse files
README.md
CHANGED
@@ -8,10 +8,13 @@ This model can be used to generate an input caption from a SMILES string.
|
|
8 |
## Example Usage
|
9 |
```python
|
10 |
from transformers import T5Tokenizer, T5ForConditionalGeneration
|
|
|
11 |
tokenizer = T5Tokenizer.from_pretrained("laituan245/molt5-small-smiles2caption", model_max_length=512)
|
12 |
model = T5ForConditionalGeneration.from_pretrained('laituan245/molt5-small-smiles2caption')
|
|
|
13 |
input_text = 'C1=CC2=C(C(=C1)[O-])NC(=CC2=O)C(=O)O'
|
14 |
input_ids = tokenizer(input_text, return_tensors="pt").input_ids
|
|
|
15 |
outputs = model.generate(input_ids, num_beams=5, max_length=512)
|
16 |
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
|
17 |
```
|
|
|
8 |
## Example Usage
|
9 |
```python
|
10 |
from transformers import T5Tokenizer, T5ForConditionalGeneration
|
11 |
+
|
12 |
tokenizer = T5Tokenizer.from_pretrained("laituan245/molt5-small-smiles2caption", model_max_length=512)
|
13 |
model = T5ForConditionalGeneration.from_pretrained('laituan245/molt5-small-smiles2caption')
|
14 |
+
|
15 |
input_text = 'C1=CC2=C(C(=C1)[O-])NC(=CC2=O)C(=O)O'
|
16 |
input_ids = tokenizer(input_text, return_tensors="pt").input_ids
|
17 |
+
|
18 |
outputs = model.generate(input_ids, num_beams=5, max_length=512)
|
19 |
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
|
20 |
```
|