Spaces:
Running
Running
Update interfaces/iupac2style.py
Browse files
interfaces/iupac2style.py
CHANGED
@@ -2,8 +2,6 @@ import gradio as gr
|
|
2 |
from utils import ChemicalConverter, validate_smiles2iupac, plot_mol, login
|
3 |
|
4 |
def convert(access_code, chemical_name, plot):
|
5 |
-
if not login(access_code):
|
6 |
-
return "Currently, you don't have access to the service."
|
7 |
# Initialize the ChemicalConverter
|
8 |
converter = ChemicalConverter(mode="IUPAC2SMILES")
|
9 |
converted_name = converter.convert(chemical_name)[:6]
|
@@ -15,11 +13,10 @@ iupac2style = gr.Interface(
|
|
15 |
fn=convert,
|
16 |
allow_flagging='auto',
|
17 |
inputs=[
|
18 |
-
gr.Textbox(label="Enter your access code", placeholder=""),
|
19 |
gr.Textbox(label="Enter your IUPAC name", placeholder="Enter IUPAC name here"),
|
20 |
],
|
21 |
outputs=[gr.Text(label="IUPAC style")],
|
22 |
examples=[
|
23 |
-
[
|
24 |
],
|
25 |
)
|
|
|
2 |
from utils import ChemicalConverter, validate_smiles2iupac, plot_mol, login
|
3 |
|
4 |
def convert(access_code, chemical_name, plot):
|
|
|
|
|
5 |
# Initialize the ChemicalConverter
|
6 |
converter = ChemicalConverter(mode="IUPAC2SMILES")
|
7 |
converted_name = converter.convert(chemical_name)[:6]
|
|
|
13 |
fn=convert,
|
14 |
allow_flagging='auto',
|
15 |
inputs=[
|
|
|
16 |
gr.Textbox(label="Enter your IUPAC name", placeholder="Enter IUPAC name here"),
|
17 |
],
|
18 |
outputs=[gr.Text(label="IUPAC style")],
|
19 |
examples=[
|
20 |
+
["propan-2-yl 2-[4-(4-chlorophenyl)carbonylphenoxy]-2-methyl-propanoate"]
|
21 |
],
|
22 |
)
|