igashov commited on
Commit
7a6d6dd
1 Parent(s): 2bdc158
Files changed (1) hide show
  1. app.py +24 -15
app.py CHANGED
@@ -165,12 +165,16 @@ with demo:
165
  gr.Markdown('## Input Fragments')
166
  gr.Markdown('Upload the file with 3D-coordinates of the input fragments in .pdb, .mol2 or .sdf format:')
167
  input_file = gr.File(file_count='single', label='Input Fragments')
 
 
 
 
168
 
169
- with gr.Row(css="#button {background-color: white; color: black;}"):
170
- with gr.Column():
171
- example1 = gr.Button('Example 1', elem_id='button')
172
- with gr.Column():
173
- example2 = gr.Button('Example 2', elem_id='button')
174
 
175
  button = gr.Button('Generate Linker!')
176
  gr.Markdown('')
@@ -190,18 +194,23 @@ with demo:
190
  inputs=[input_file],
191
  outputs=[visualization, output_files],
192
  )
193
-
194
- example1.click(
195
- fn=lambda: ['examples/example_1.sdf', show_input('examples/example_1.sdf')],
196
- inputs=[],
197
- outputs=[input_file, visualization],
198
- )
199
- example2.click(
200
- fn=lambda: ['examples/example_2.sdf', show_input('examples/example_2.sdf')],
201
- inputs=[],
202
- outputs=[input_file, visualization],
203
  )
204
 
 
 
 
 
 
 
 
 
 
 
 
205
  # examples = gr.Examples(
206
  # examples=[['examples/example_1.sdf'], ['examples/example_2.sdf']],
207
  # inputs=[input_file],
 
165
  gr.Markdown('## Input Fragments')
166
  gr.Markdown('Upload the file with 3D-coordinates of the input fragments in .pdb, .mol2 or .sdf format:')
167
  input_file = gr.File(file_count='single', label='Input Fragments')
168
+ examples = gr.Dataset(
169
+ components=[input_file],
170
+ samples=[['examples/example_1.sdf'], ['examples/example_2.sdf']],
171
+ )
172
 
173
+ # with gr.Row(css="#button {background-color: white; color: black;}"):
174
+ # with gr.Column():
175
+ # example1 = gr.Button('Example 1', elem_id='button')
176
+ # with gr.Column():
177
+ # example2 = gr.Button('Example 2', elem_id='button')
178
 
179
  button = gr.Button('Generate Linker!')
180
  gr.Markdown('')
 
194
  inputs=[input_file],
195
  outputs=[visualization, output_files],
196
  )
197
+ examples.click(
198
+ fn=lambda inp: [inp, show_input(inp)],
199
+ inputs=[input_file],
200
+ outputs=[input_file, visualization]
 
 
 
 
 
 
201
  )
202
 
203
+ # example1.click(
204
+ # fn=lambda: ['examples/example_1.sdf', show_input('examples/example_1.sdf')],
205
+ # inputs=[],
206
+ # outputs=[input_file, visualization],
207
+ # )
208
+ # example2.click(
209
+ # fn=lambda: ['examples/example_2.sdf', show_input('examples/example_2.sdf')],
210
+ # inputs=[],
211
+ # outputs=[input_file, visualization],
212
+ # )
213
+
214
  # examples = gr.Examples(
215
  # examples=[['examples/example_1.sdf'], ['examples/example_2.sdf']],
216
  # inputs=[input_file],