igashov commited on
Commit
41efc4f
·
1 Parent(s): 9a275b5
Files changed (1) hide show
  1. app.py +9 -5
app.py CHANGED
@@ -157,15 +157,23 @@ def generate(input_file):
157
  demo = gr.Blocks()
158
  with demo:
159
  gr.Markdown('# DiffLinker: Equivariant 3D-Conditional Diffusion Model for Molecular Linker Design')
 
160
  with gr.Box():
161
  with gr.Row():
162
  with gr.Column():
163
  gr.Markdown('## Input Fragments')
164
  gr.Markdown('Upload the file with 3D-coordinates of the input fragments in .pdb, .mol2 or .sdf format:')
165
- input_file = gr.File(file_count='single', label='Input Fragments')
 
 
 
 
166
  examples = gr.Examples(
167
  examples=[['examples/example_1.sdf'], ['examples/example_2.sdf']],
168
  inputs=[input_file],
 
 
 
169
  )
170
  button = gr.Button('Generate Linker!')
171
  gr.Markdown('')
@@ -175,10 +183,6 @@ with demo:
175
  with gr.Column():
176
  visualization = gr.HTML()
177
 
178
- examples.outputs = [visualization]
179
- examples.fn = show_input
180
- examples.run_on_click = True
181
-
182
  input_file.change(
183
  fn=show_input,
184
  inputs=[input_file],
 
157
  demo = gr.Blocks()
158
  with demo:
159
  gr.Markdown('# DiffLinker: Equivariant 3D-Conditional Diffusion Model for Molecular Linker Design')
160
+ visualization = gr.Variable()
161
  with gr.Box():
162
  with gr.Row():
163
  with gr.Column():
164
  gr.Markdown('## Input Fragments')
165
  gr.Markdown('Upload the file with 3D-coordinates of the input fragments in .pdb, .mol2 or .sdf format:')
166
+ input_file = gr.File(
167
+ # value='examples/example_1.sdf',
168
+ file_count='single',
169
+ label='Input Fragments'
170
+ )
171
  examples = gr.Examples(
172
  examples=[['examples/example_1.sdf'], ['examples/example_2.sdf']],
173
  inputs=[input_file],
174
+ outputs=[visualization],
175
+ fn=show_input,
176
+ run_on_click=True,
177
  )
178
  button = gr.Button('Generate Linker!')
179
  gr.Markdown('')
 
183
  with gr.Column():
184
  visualization = gr.HTML()
185
 
 
 
 
 
186
  input_file.change(
187
  fn=show_input,
188
  inputs=[input_file],