laituan245 commited on
Commit
9e82786
·
1 Parent(s): b78a878

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +3 -0
README.md CHANGED
@@ -7,10 +7,13 @@ This model can be used to generate a SMILES string from an input caption.
7
  ## Example Usage
8
  ```python
9
  from transformers import T5Tokenizer, T5ForConditionalGeneration
 
10
  tokenizer = T5Tokenizer.from_pretrained("laituan245/molt5-large-caption2smiles", model_max_length=512)
11
  model = T5ForConditionalGeneration.from_pretrained('laituan245/molt5-large-caption2smiles')
 
12
  input_text = 'The molecule is a monomethoxybenzene that is 2-methoxyphenol substituted by a hydroxymethyl group at position 4. It has a role as a plant metabolite. It is a member of guaiacols and a member of benzyl alcohols.'
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-caption2smiles", model_max_length=512)
12
  model = T5ForConditionalGeneration.from_pretrained('laituan245/molt5-large-caption2smiles')
13
+
14
  input_text = 'The molecule is a monomethoxybenzene that is 2-methoxyphenol substituted by a hydroxymethyl group at position 4. It has a role as a plant metabolite. It is a member of guaiacols and a member of benzyl alcohols.'
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
  ```