igashov commited on
Commit
ed144d4
1 Parent(s): fffb501
Files changed (1) hide show
  1. app.py +13 -3
app.py CHANGED
@@ -218,7 +218,7 @@ with demo:
218
  gr.Markdown('')
219
  gr.Markdown('## Output Files')
220
  gr.Markdown('Download files with the generated molecules here:')
221
- output_files = gr.File(file_count='multiple', label='Output Files')
222
  with gr.Column():
223
  gr.Markdown('## Visualization')
224
  # gr.Markdown('Below you will see input and output molecules')
@@ -238,9 +238,14 @@ with demo:
238
  outputs=[visualization],
239
  )
240
  examples.click(
241
- fn=lambda idx: [f'examples/example_{idx+1}.sdf', 10, show_input(f'examples/example_{idx+1}.sdf')],
 
 
 
 
 
242
  inputs=[examples],
243
- outputs=[input_file, n_steps, visualization]
244
  )
245
  button.click(
246
  fn=generate,
@@ -252,5 +257,10 @@ with demo:
252
  inputs=[samples, output_files],
253
  outputs=[visualization],
254
  )
 
 
 
 
 
255
 
256
  demo.launch(server_name=args.ip)
 
218
  gr.Markdown('')
219
  gr.Markdown('## Output Files')
220
  gr.Markdown('Download files with the generated molecules here:')
221
+ output_files = gr.File(file_count='multiple', label='Output Files', interactive=False)
222
  with gr.Column():
223
  gr.Markdown('## Visualization')
224
  # gr.Markdown('Below you will see input and output molecules')
 
238
  outputs=[visualization],
239
  )
240
  examples.click(
241
+ fn=lambda idx: [
242
+ f'examples/example_{idx+1}.sdf',
243
+ 10,
244
+ show_input(f'examples/example_{idx+1}.sdf'),
245
+ gr.Radio(value='Sample 1', visible=False)
246
+ ],
247
  inputs=[examples],
248
+ outputs=[input_file, n_steps, visualization, samples]
249
  )
250
  button.click(
251
  fn=generate,
 
257
  inputs=[samples, output_files],
258
  outputs=[visualization],
259
  )
260
+ output_files.clear(
261
+ fn=lambda: ['', gr.Radio(value='Sample 1', visible=False)],
262
+ inputs=[],
263
+ outputs=[visualization, samples],
264
+ )
265
 
266
  demo.launch(server_name=args.ip)