Spaces:
Running on Zero
Running on Zero
fix main run button logic
Browse files- app.py +17 -9
- utils/__init__.py +4 -4
- utils/handle_events.py +3 -1
app.py
CHANGED
|
@@ -8,7 +8,7 @@ import spaces
|
|
| 8 |
from atomworks.io.utils.visualize import view
|
| 9 |
from lightning.fabric import seed_everything
|
| 10 |
from rfd3.engine import RFD3InferenceConfig, RFD3InferenceEngine
|
| 11 |
-
from utils import download_weights
|
| 12 |
from utils.pipelines import test_rfd3_from_notebook, unconditional_generation
|
| 13 |
#from gradio_molecule3d import Molecule3D
|
| 14 |
from utils.handle_events import *
|
|
@@ -181,16 +181,24 @@ with gr.Blocks(title="RFD3 Test") as demo:
|
|
| 181 |
|
| 182 |
run_btn.click(give_run_status, inputs=[config_ready, scaffold_ready, num_batches, num_designs_per_batch, length], outputs=runtextbox).then(
|
| 183 |
generate, inputs=[config_ready, scaffold_ready, num_batches, num_designs_per_batch, length], outputs=[gen_directory, gen_results]
|
| 184 |
-
)
|
| 185 |
-
|
| 186 |
-
run_btn.click(unconditional_generation, inputs=[num_batches, num_designs_per_batch, length], outputs=[gen_directory, gen_results]).then(
|
| 187 |
update_batch_choices,
|
| 188 |
inputs=gen_results,
|
| 189 |
-
outputs=batch_dropdown
|
| 190 |
-
|
| 191 |
-
|
| 192 |
-
|
| 193 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 194 |
|
| 195 |
batch_dropdown.change(update_designs, inputs=[batch_dropdown, gen_results], outputs=[design_dropdown])
|
| 196 |
design_dropdown.change()
|
|
|
|
| 8 |
from atomworks.io.utils.visualize import view
|
| 9 |
from lightning.fabric import seed_everything
|
| 10 |
from rfd3.engine import RFD3InferenceConfig, RFD3InferenceEngine
|
| 11 |
+
from utils.download_weights import download_weights
|
| 12 |
from utils.pipelines import test_rfd3_from_notebook, unconditional_generation
|
| 13 |
#from gradio_molecule3d import Molecule3D
|
| 14 |
from utils.handle_events import *
|
|
|
|
| 181 |
|
| 182 |
run_btn.click(give_run_status, inputs=[config_ready, scaffold_ready, num_batches, num_designs_per_batch, length], outputs=runtextbox).then(
|
| 183 |
generate, inputs=[config_ready, scaffold_ready, num_batches, num_designs_per_batch, length], outputs=[gen_directory, gen_results]
|
| 184 |
+
).then(
|
|
|
|
|
|
|
| 185 |
update_batch_choices,
|
| 186 |
inputs=gen_results,
|
| 187 |
+
outputs=batch_dropdown
|
| 188 |
+
).then(
|
| 189 |
+
download_results_as_zip,
|
| 190 |
+
inputs=gen_directory,
|
| 191 |
+
outputs=output_file
|
| 192 |
+
)
|
| 193 |
+
|
| 194 |
+
#run_btn.click(unconditional_generation, inputs=[num_batches, num_designs_per_batch, length], outputs=[gen_directory, gen_results]).then(
|
| 195 |
+
# update_batch_choices,
|
| 196 |
+
# inputs=gen_results,
|
| 197 |
+
# outputs=batch_dropdown).then(
|
| 198 |
+
# download_results_as_zip,
|
| 199 |
+
# inputs=gen_directory,
|
| 200 |
+
# outputs=output_file
|
| 201 |
+
# )
|
| 202 |
|
| 203 |
batch_dropdown.change(update_designs, inputs=[batch_dropdown, gen_results], outputs=[design_dropdown])
|
| 204 |
design_dropdown.change()
|
utils/__init__.py
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
from utils.download_weights import *
|
| 2 |
-
from utils.pipelines import *
|
| 3 |
-
|
| 4 |
-
__all__ = ["download_weights"]
|
|
|
|
| 1 |
+
#from utils.download_weights import *
|
| 2 |
+
#from utils.pipelines import *
|
| 3 |
+
#
|
| 4 |
+
#__all__ = ["download_weights"]
|
utils/handle_events.py
CHANGED
|
@@ -53,4 +53,6 @@ def show_pdb(batch, design, result):
|
|
| 53 |
pdb_path= next(d["pdb_path"] for d in result if d["batch"] == int(batch) and d["design"] == int(design))
|
| 54 |
with open(pdb_path, 'r') as f:
|
| 55 |
pdb_str = f.read()
|
| 56 |
-
|
|
|
|
|
|
|
|
|
| 53 |
pdb_path= next(d["pdb_path"] for d in result if d["batch"] == int(batch) and d["design"] == int(design))
|
| 54 |
with open(pdb_path, 'r') as f:
|
| 55 |
pdb_str = f.read()
|
| 56 |
+
print(pdb_path)
|
| 57 |
+
print(pdb_str)
|
| 58 |
+
return gr.update(value=f"Selected Batch: {batch}, Design: {design}, saved at {pdb_path}:\n {pdb_str}", visible=True)
|