VIATEUR-AI commited on
Commit
087fadd
·
verified ·
1 Parent(s): 34d6f67

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +0 -22
app.py CHANGED
@@ -1,22 +0,0 @@
1
- import py3Dmol
2
- import gradio as gr
3
-
4
- def show_h2(bond_length):
5
- bond_length = float(bond_length)
6
-
7
- xyz = f"""
8
- H 0 0 0
9
- H 0 0 {bond_length}
10
- """
11
- view = py3Dmol.view(width=400, height=400)
12
- view.addModel(xyz, 'xyz')
13
- view.setStyle({'stick':{}})
14
- view.zoomTo()
15
-
16
- return view.show()
17
-
18
- iface = gr.Interface(fn=show_h2,
19
- inputs=gr.Textbox(label="Bond Length Å"),
20
- outputs="py3Dmol",
21
- title="H2 Molecule 3D Viewer")
22
- iface.launch(share=True)