Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -19,7 +19,24 @@ def predict(smiles):
|
|
19 |
postprocess_data = '{:.2e}'.format(pow(10, result[0]))
|
20 |
return postprocess_data
|
21 |
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
postprocess_data = '{:.2e}'.format(pow(10, result[0]))
|
20 |
return postprocess_data
|
21 |
|
22 |
+
|
23 |
+
with gr.Blocks() as demo:
|
24 |
+
with gr.Row():
|
25 |
+
with gr.Column():
|
26 |
+
inputs=gr.Textbox(lines=2, label="Please enter SMILES for the compound")
|
27 |
+
with gr.Row():
|
28 |
+
btn = gr.Button(variant="primary",value="submit")
|
29 |
+
clear_btn = gr.ClearButton(value="clear")
|
30 |
+
with gr.Column():
|
31 |
+
outputs=gr.Textbox(lines=1, label="Predicted CHO cytotoxicity of the chemical is:",info="Unit: Molar Concentration")
|
32 |
+
|
33 |
+
btn.click(predict, inputs=[inputs], outputs=[outputs])
|
34 |
+
clear_btn.add([inputs,outputs])
|
35 |
+
|
36 |
+
gr.Examples(
|
37 |
+
[["O=C(O)CBr"],["O=CC(Br)(Br)Br"],["IC(Br)Br"]],
|
38 |
+
[inputs],
|
39 |
+
)
|
40 |
+
|
41 |
+
if __name__ == "__main__":
|
42 |
+
demo.launch()
|