gabboud commited on
Commit
89389c9
·
1 Parent(s): 7b91667

fix main run button logic

Browse files
Files changed (3) hide show
  1. app.py +17 -9
  2. utils/__init__.py +4 -4
  3. 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).then(
190
- download_results_as_zip,
191
- inputs=gen_directory,
192
- outputs=output_file
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
- return gr.update(value=f"Selected Batch: {batch}, Design: {design}, saved at {pdb_str}:\n {pdb_str}", visible=True)
 
 
 
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)