sadgaj commited on
Commit
2b734c6
1 Parent(s): 8da2621

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -7,11 +7,11 @@ def greet(name):
7
  model = AutoModelForSeq2SeqLM.from_pretrained("zjunlp/MolGen")
8
 
9
  sf_input = tokenizer(name, return_tensors="pt")
10
- return sf_input
11
  # beam search
12
- #molecules = model.generate(input_ids=sf_input["input_ids"],
13
- #sf_output = [tokenizer.decode(g, skip_special_tokens=True, clean_up_tokenization_spaces=True).replace(" ","") for g in molecules]
14
- #return name
15
 
16
  iface = gr.Interface(fn=greet, inputs="text", outputs="text")
17
  iface.launch()
 
7
  model = AutoModelForSeq2SeqLM.from_pretrained("zjunlp/MolGen")
8
 
9
  sf_input = tokenizer(name, return_tensors="pt")
10
+
11
  # beam search
12
+ molecules = model.generate(input_ids=sf_input["input_ids"],
13
+ sf_output = [tokenizer.decode(g, skip_special_tokens=True, clean_up_tokenization_spaces=True).replace(" ","") for g in molecules]
14
+ return sf_output
15
 
16
  iface = gr.Interface(fn=greet, inputs="text", outputs="text")
17
  iface.launch()