yzimmermann commited on
Commit
a117e93
·
verified ·
1 Parent(s): 200088e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -6
app.py CHANGED
@@ -4,7 +4,7 @@ from transformers import pipeline
4
  import gradio as gr
5
 
6
  model_checkpoint = "yzimmermann/FART"
7
- classifier = pipeline("text-classification", model=model_checkpoint, return_all_scores=True)
8
 
9
  def process_smiles(smiles):
10
  # Validate and canonicalize SMILES
@@ -26,14 +26,13 @@ def process_smiles(smiles):
26
 
27
  return prediction_dict, img_path, canonical_smiles
28
 
29
- # Set up the Gradio interface
30
  iface = gr.Interface(
31
  fn=process_smiles,
32
- inputs=gr.inputs.Textbox(label="Input SMILES"),
33
  outputs=[
34
- gr.outputs.Label(num_top_classes=3, label="Classification Probabilities"),
35
- gr.outputs.Image(type="file", label="Molecule Image"),
36
- gr.outputs.Textbox(label="Canonical SMILES")
37
  ],
38
  title="FART",
39
  description="Enter a SMILES string to get the taste classification probabilities."
 
4
  import gradio as gr
5
 
6
  model_checkpoint = "yzimmermann/FART"
7
+ classifier = pipeline("text-classification", model=model_checkpoint, top_k=None)
8
 
9
  def process_smiles(smiles):
10
  # Validate and canonicalize SMILES
 
26
 
27
  return prediction_dict, img_path, canonical_smiles
28
 
 
29
  iface = gr.Interface(
30
  fn=process_smiles,
31
+ inputs=gr.Textbox(label="Input SMILES"),
32
  outputs=[
33
+ gr.Label(num_top_classes=3, label="Classification Probabilities"),
34
+ gr.Image(type="file", label="Molecule Image"),
35
+ gr.Textbox(label="Canonical SMILES")
36
  ],
37
  title="FART",
38
  description="Enter a SMILES string to get the taste classification probabilities."