Spaces:
Runtime error
Runtime error
Create new file
Browse files
app.py
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
import os
|
| 3 |
+
import sys
|
| 4 |
+
|
| 5 |
+
|
| 6 |
+
def generate(input_file):
|
| 7 |
+
try:
|
| 8 |
+
path = input_file.name
|
| 9 |
+
except:
|
| 10 |
+
return 'Error!'
|
| 11 |
+
|
| 12 |
+
return 'Success!'
|
| 13 |
+
|
| 14 |
+
|
| 15 |
+
demo = gr.Blocks()
|
| 16 |
+
with demo:
|
| 17 |
+
gr.Markdown('# DiffLinker: Equivariant 3D-Conditional Diffusion Model for Molecular Linker Design')
|
| 18 |
+
with gr.Box():
|
| 19 |
+
with gr.Row():
|
| 20 |
+
gr.Markdown('## Input Fragments')
|
| 21 |
+
input_file = gr.File(file_count='single', label='Input fragments in .mol2 or .sdf format')
|
| 22 |
+
|
| 23 |
+
button = gr.Button('Generate Linker!')
|
| 24 |
+
|
| 25 |
+
gr.Markdown('## Result')
|
| 26 |
+
visualization = gr.HTML()
|
| 27 |
+
|
| 28 |
+
button.click(
|
| 29 |
+
fn=generate,
|
| 30 |
+
inputs=[input_file],
|
| 31 |
+
outputs=[visualization],
|
| 32 |
+
)
|
| 33 |
+
|
| 34 |
+
demo.launch()
|