File size: 1,137 Bytes
bebad14
 
 
dffaf30
 
bebad14
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
dffaf30
bebad14
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
36
37
38
39
40

import time

import gradio as gr

from gradio_molecule3d import Molecule3D


def predict (input_sequence, input_ligand):
    start_time = time.time()
    # Do inference here
    # return an output directory
    end_time = time.time()
    run_time = end_time - start_time
    return None, run_time

with gr.Blocks as app:

    gr.Markdown("# Template for inference")

    gr.Markdown("Title, description, and other information about the model")   
    with gr.Row():
        input_sequence = gr.Textbox(lines=3, label="Input sequence")
        input_ligand = gr.Textbox(lines=3, label="Input ligand SMILES")
    
    # define any options here

    # the final for inference should be the default options
    # slider_option = gr.Slider(0,10, label="Slider Option")
    # checkbox_option = gr.Checkbox(label="Checkbox Option")
    # dropdown_option = gr.Dropdown(["Option 1", "Option 2", "Option 3"], label="Radio Option")

    btn = gr.Button(label="Run Inference")
    out = gr.Molecule3D()
    run_time = gr.Textbox(label="Runtime")

    btn.click(predict, inputs=[input_sequence, input_ligand], outputs=[out, run_time])

app.launch()