File size: 746 Bytes
7782ac2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import gradio as gr
import os
import sys


def generate(input_file):
    try:
        path = input_file.name
    except:
        return 'Error!'
    
    return 'Success!'


demo = gr.Blocks()
with demo:
    gr.Markdown('# DiffLinker: Equivariant 3D-Conditional Diffusion Model for Molecular Linker Design')
    with gr.Box():
        with gr.Row():
            gr.Markdown('## Input Fragments')
            input_file = gr.File(file_count='single', label='Input fragments in .mol2 or .sdf format')
            
    button = gr.Button('Generate Linker!')
    
    gr.Markdown('## Result')
    visualization = gr.HTML()
    
    button.click(
        fn=generate,
        inputs=[input_file],
        outputs=[visualization],
    )

demo.launch()