gabboud commited on
Commit
eaf76e5
·
1 Parent(s): bab929f
Files changed (2) hide show
  1. app.py +3 -3
  2. utils/pipelines.py +1 -1
app.py CHANGED
@@ -9,7 +9,7 @@ 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, unconditional_generation_with_input_config
13
  #from gradio_molecule3d import Molecule3D
14
  from utils.handle_events import *
15
  from utils.handle_files import *
@@ -114,12 +114,12 @@ with gr.Blocks(title="RFD3 Test") as demo:
114
  if config_ready is None or scaffold_ready is None:
115
  return None, None
116
  if config_ready == "upload" and scaffold_ready == "no_input":
117
- gen_directory, gen_results = unconditional_generation_with_input_config(config_upload, num_batches, num_designs_per_batch, extra_args)
118
  return gen_directory, gen_results
119
  else:
120
  return None, None
121
 
122
- run_btn.click(give_run_status, inputs=[config_ready, scaffold_ready, num_batches, num_designs_per_batch, config_upload], outputs=runtextbox.then(
123
  generate, inputs=[config_ready, scaffold_ready, num_batches, num_designs_per_batch, config_upload, extra_args], outputs=[gen_directory, gen_results]
124
  ).then(
125
  update_batch_choices,
 
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, generation_with_input_config
13
  #from gradio_molecule3d import Molecule3D
14
  from utils.handle_events import *
15
  from utils.handle_files import *
 
114
  if config_ready is None or scaffold_ready is None:
115
  return None, None
116
  if config_ready == "upload" and scaffold_ready == "no_input":
117
+ gen_directory, gen_results = generation_with_input_config(config_upload, num_batches, num_designs_per_batch, extra_args)
118
  return gen_directory, gen_results
119
  else:
120
  return None, None
121
 
122
+ run_btn.click(give_run_status, inputs=[config_ready, scaffold_ready, num_batches, num_designs_per_batch, config_upload], outputs=runtextbox).then(
123
  generate, inputs=[config_ready, scaffold_ready, num_batches, num_designs_per_batch, config_upload, extra_args], outputs=[gen_directory, gen_results]
124
  ).then(
125
  update_batch_choices,
utils/pipelines.py CHANGED
@@ -99,7 +99,7 @@ def unconditional_generation(num_batches, num_designs_per_batch, length):
99
  raise RuntimeError(f"Error during generation: {str(e)}")
100
 
101
  @spaces.GPU(duration=300)
102
- def unconditional_generation_with_input_config(input_file, num_batches, num_designs_per_batch, extra_args):
103
  """
104
  Runs an unconditional generation with the specified input config file. Saves the generated structures to a timestamped directory in the outputs folder and returns the path to the directory along with a list of the generated structures' file paths.
105
 
 
99
  raise RuntimeError(f"Error during generation: {str(e)}")
100
 
101
  @spaces.GPU(duration=300)
102
+ def generation_with_input_config(input_file, num_batches, num_designs_per_batch, extra_args):
103
  """
104
  Runs an unconditional generation with the specified input config file. Saves the generated structures to a timestamped directory in the outputs folder and returns the path to the directory along with a list of the generated structures' file paths.
105