wenhao-gao
commited on
Commit
·
1b7c1ca
1
Parent(s):
f57c985
update
Browse files
app.py
CHANGED
@@ -17,7 +17,7 @@ last_result = {}
|
|
17 |
# Function to clear all inputs
|
18 |
def clear_inputs():
|
19 |
# Return default or empty values to reset each input component
|
20 |
-
return None,
|
21 |
|
22 |
def sample(smi, search_width, exhaustiveness):
|
23 |
result_df = run_sampling_one_cpu(
|
@@ -58,7 +58,7 @@ with gr.Blocks() as demo:
|
|
58 |
# Demo of [SynFormer](https://github.com/wenhao-gao/synformer/tree/main)
|
59 |
This page demonstrates the SynFormer-ED model, which takes a molecule as input—regardless of its synthetic accessibility—and outputs
|
60 |
identical or approximate molecules along with their associated synthetic paths. The demo runs on CPUs and typically takes about
|
61 |
-
one minute per run but can be accelerated by reducing the search width and exhaustiveness. The model may take longer if the server
|
62 |
is busy. Since the sampling is stochastic, you may run the demo multiple times to explore different results, with a maximum of
|
63 |
30 molecules displayed at once.
|
64 |
To learn more about SynFormer’s architecture and applications, check out [our paper](https://github.com/wenhao-gao/synformer/tree/main).
|
@@ -68,8 +68,8 @@ with gr.Blocks() as demo:
|
|
68 |
with gr.Row():
|
69 |
with gr.Column(scale=0.5):
|
70 |
input_molecule = molecule2d(label="SMILES Input")
|
71 |
-
slider_1 = gr.Slider(minimum=1, maximum=100, step=1, label="Search Width", value=
|
72 |
-
slider_2 = gr.Slider(minimum=1, maximum=100, step=1, label="Exhaustiveness", value=
|
73 |
|
74 |
with gr.Row():
|
75 |
with gr.Column(scale=0.5):
|
@@ -119,4 +119,4 @@ with gr.Blocks() as demo:
|
|
119 |
outputs=[input_molecule, slider_1, slider_2, index_slider]
|
120 |
)
|
121 |
|
122 |
-
demo.launch()
|
|
|
17 |
# Function to clear all inputs
|
18 |
def clear_inputs():
|
19 |
# Return default or empty values to reset each input component
|
20 |
+
return None, 8, 8, 0
|
21 |
|
22 |
def sample(smi, search_width, exhaustiveness):
|
23 |
result_df = run_sampling_one_cpu(
|
|
|
58 |
# Demo of [SynFormer](https://github.com/wenhao-gao/synformer/tree/main)
|
59 |
This page demonstrates the SynFormer-ED model, which takes a molecule as input—regardless of its synthetic accessibility—and outputs
|
60 |
identical or approximate molecules along with their associated synthetic paths. The demo runs on CPUs and typically takes about
|
61 |
+
one minute per run on local machine, but can be accelerated by reducing the search width and exhaustiveness. The model may take longer if the server
|
62 |
is busy. Since the sampling is stochastic, you may run the demo multiple times to explore different results, with a maximum of
|
63 |
30 molecules displayed at once.
|
64 |
To learn more about SynFormer’s architecture and applications, check out [our paper](https://github.com/wenhao-gao/synformer/tree/main).
|
|
|
68 |
with gr.Row():
|
69 |
with gr.Column(scale=0.5):
|
70 |
input_molecule = molecule2d(label="SMILES Input")
|
71 |
+
slider_1 = gr.Slider(minimum=1, maximum=100, step=1, label="Search Width", value=8)
|
72 |
+
slider_2 = gr.Slider(minimum=1, maximum=100, step=1, label="Exhaustiveness", value=8)
|
73 |
|
74 |
with gr.Row():
|
75 |
with gr.Column(scale=0.5):
|
|
|
119 |
outputs=[input_molecule, slider_1, slider_2, index_slider]
|
120 |
)
|
121 |
|
122 |
+
demo.launch()
|