Spaces:
Sleeping
Sleeping
app
Browse files
app.py
CHANGED
@@ -164,17 +164,12 @@ with demo:
|
|
164 |
with gr.Column():
|
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=[
|
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,9 +189,15 @@ with demo:
|
|
194 |
inputs=[input_file],
|
195 |
outputs=[visualization, output_files],
|
196 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
197 |
examples.click(
|
198 |
-
fn=lambda
|
199 |
-
inputs=[
|
200 |
outputs=[input_file, visualization]
|
201 |
)
|
202 |
|
|
|
164 |
with gr.Column():
|
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=[gr.File(visible=False)],
|
170 |
samples=[['examples/example_1.sdf'], ['examples/example_2.sdf']],
|
171 |
+
type='index',
|
172 |
+
)
|
|
|
|
|
|
|
|
|
|
|
173 |
|
174 |
button = gr.Button('Generate Linker!')
|
175 |
gr.Markdown('')
|
|
|
189 |
inputs=[input_file],
|
190 |
outputs=[visualization, output_files],
|
191 |
)
|
192 |
+
|
193 |
+
# def foo(idx):
|
194 |
+
# print('INPUT:', idx)
|
195 |
+
# input_path = f'examples/example_{idx+1}.sdf'
|
196 |
+
# return [input_path, show_input(input_path)]
|
197 |
+
|
198 |
examples.click(
|
199 |
+
fn=lambda idx: [f'examples/example_{idx+1}.sdf', show_input(f'examples/example_{idx+1}.sdf')],
|
200 |
+
inputs=[examples],
|
201 |
outputs=[input_file, visualization]
|
202 |
)
|
203 |
|