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