Spaces:
Running
Running
File size: 756 Bytes
8adb95d |
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 |
import gradio as gr
from gradio_moleculeview import moleculeview
def predict(input_mol, view_str, chains):
return "svg"
with gr.Blocks() as demo:
gr.Markdown("# Molecule3D")
inp = moleculeview(label="Molecule3D")
view_str = gr.Textbox("viewMatrixResult", label="View Matrix", visible=False)
chains = gr.Textbox("chainsResult", label="Chains", visible=False)
btn = gr.Button("Predict")
html = gr.HTML("")
btn.click(None, [], [view_str, chains], js="() => [document.getElementById('viewMatrixResult').value, document.getElementById('chains').value]") #
# on change of chains trigger, rendering
chains.change(predict, [inp, view_str, chains], html)
if __name__ == "__main__":
demo.launch()
|