gabboud commited on
Commit
e4ccd50
·
1 Parent(s): eaf76e5

support pdb input

Browse files
Files changed (2) hide show
  1. app.py +3 -0
  2. utils/handle_events.py +8 -6
app.py CHANGED
@@ -116,6 +116,9 @@ with gr.Blocks(title="RFD3 Test") as demo:
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
 
 
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
+ if config_ready=="upload" and scaffold_ready=="upload":
120
+ gen_directory, gen_results = generation_with_input_config(config_upload, num_batches, num_designs_per_batch, extra_args)
121
+ return gen_directory, gen_results
122
  else:
123
  return None, None
124
 
utils/handle_events.py CHANGED
@@ -106,7 +106,7 @@ def validate_scaffold_ready_with_file(scaffold_upload):
106
  else:
107
  return "Please upload a scaffold file or press 'No Scaffold/Target' for unconditional generation.", None
108
 
109
- def give_run_status(config_ready, scaffold_ready, num_batches, num_designs_per_batch, config_upload):
110
  """
111
  Once the user presses on the Run Generation button, this function checks whether both config and scaffold are ready, and gives a status message about the generation run that is about to happen. If both config and scaffold are not ready, it prompts the user to ensure they are both validated before running the generation.
112
 
@@ -117,13 +117,13 @@ def give_run_status(config_ready, scaffold_ready, num_batches, num_designs_per_b
117
  scaffold_ready: gr.State
118
  status string for scaffold readiness, is "upload" if scaffold file is uploaded and valid, "no_input" if no scaffold/target is selected for unconditioned generation, and None if scaffold is not ready for generation
119
  num_batches: gr.Number
120
- number of batches input by the user in the manual config, used for the generation status message
121
  num_designs_per_batch: gr.Number
122
- number of designs per batch input by the user in the manual config, used for the generation
123
- length: gr.Number
124
- length input by the user in the manual config, used for the generation status message
125
  config_upload: gr.File
126
- uploaded config file, used for the generation status message if upload config is selected
 
 
127
 
128
  Returns:
129
  -------
@@ -135,5 +135,7 @@ def give_run_status(config_ready, scaffold_ready, num_batches, num_designs_per_b
135
  return gr.update(value="Please ensure both config and scaffold are validated before running the generation.")
136
  elif config_ready == "upload" and scaffold_ready == "no_input":
137
  return gr.update(value=f"Running unconditional generation for {num_batches} batches of {num_designs_per_batch}, config uploaded from file {os.path.basename(config_upload)}")
 
 
138
  else:
139
  return gr.update(value=f"Not implemented yet")
 
106
  else:
107
  return "Please upload a scaffold file or press 'No Scaffold/Target' for unconditional generation.", None
108
 
109
+ def give_run_status(config_ready, scaffold_ready, num_batches, num_designs_per_batch, config_upload, scaffold_upload):
110
  """
111
  Once the user presses on the Run Generation button, this function checks whether both config and scaffold are ready, and gives a status message about the generation run that is about to happen. If both config and scaffold are not ready, it prompts the user to ensure they are both validated before running the generation.
112
 
 
117
  scaffold_ready: gr.State
118
  status string for scaffold readiness, is "upload" if scaffold file is uploaded and valid, "no_input" if no scaffold/target is selected for unconditioned generation, and None if scaffold is not ready for generation
119
  num_batches: gr.Number
120
+ number of batches input by the user manually
121
  num_designs_per_batch: gr.Number
122
+ number of designs per batch input by the user manually
 
 
123
  config_upload: gr.File
124
+ uploaded config file, is None if no file is uploaded
125
+ scaffold_upload: gr.File
126
+ uploaded scaffold file, is None if no file is uploaded
127
 
128
  Returns:
129
  -------
 
135
  return gr.update(value="Please ensure both config and scaffold are validated before running the generation.")
136
  elif config_ready == "upload" and scaffold_ready == "no_input":
137
  return gr.update(value=f"Running unconditional generation for {num_batches} batches of {num_designs_per_batch}, config uploaded from file {os.path.basename(config_upload)}")
138
+ elif config_ready=="upload" and scaffold_ready=="upload":
139
+ return gr.update(value=f"Running conditional generation for {num_batches} batches of {num_designs_per_batch}, config uploaded from file {config_upload}, scaffold uploaded a {scaffold_upload}")
140
  else:
141
  return gr.update(value=f"Not implemented yet")