Yin Fang
commited on
Commit
·
8c3e4b8
1
Parent(s):
4553e37
Update README.md
Browse files
README.md
CHANGED
|
@@ -25,7 +25,7 @@ Molecule generation example:
|
|
| 25 |
>>> from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
|
| 26 |
|
| 27 |
>>> tokenizer = AutoTokenizer.from_pretrained("zjunlp/MolGen")
|
| 28 |
-
>>> model =
|
| 29 |
|
| 30 |
>>> sf_input = tokenizer("[C][=C][C][=C][C][=C][Ring1][=Branch1]", return_tensors="pt")
|
| 31 |
>>> # beam search
|
|
@@ -34,8 +34,7 @@ Molecule generation example:
|
|
| 34 |
max_length=15,
|
| 35 |
min_length=5,
|
| 36 |
num_return_sequences=5,
|
| 37 |
-
num_beams=5
|
| 38 |
-
past_prompt=None)
|
| 39 |
>>> sf_output = [tokenizer.decode(g, skip_special_tokens=True, clean_up_tokenization_spaces=True).replace(" ","") for g in molecules]
|
| 40 |
['[C][=C][C][=C][C][=C][Ring1][=Branch1]',
|
| 41 |
'[C][=C][C][=C][C][=C][C][=C][Ring1][=Branch1]',
|
|
|
|
| 25 |
>>> from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
|
| 26 |
|
| 27 |
>>> tokenizer = AutoTokenizer.from_pretrained("zjunlp/MolGen")
|
| 28 |
+
>>> model = AutoModelForSeq2SeqLM.from_pretrained("zjunlp/MolGen")
|
| 29 |
|
| 30 |
>>> sf_input = tokenizer("[C][=C][C][=C][C][=C][Ring1][=Branch1]", return_tensors="pt")
|
| 31 |
>>> # beam search
|
|
|
|
| 34 |
max_length=15,
|
| 35 |
min_length=5,
|
| 36 |
num_return_sequences=5,
|
| 37 |
+
num_beams=5)
|
|
|
|
| 38 |
>>> sf_output = [tokenizer.decode(g, skip_special_tokens=True, clean_up_tokenization_spaces=True).replace(" ","") for g in molecules]
|
| 39 |
['[C][=C][C][=C][C][=C][Ring1][=Branch1]',
|
| 40 |
'[C][=C][C][=C][C][=C][C][=C][Ring1][=Branch1]',
|