Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
def run():
|
2 |
+
print("Starting server....")
|
3 |
+
|
4 |
+
html = f"""
|
5 |
+
<iframe
|
6 |
+
src="http://{HOST}:{PORT}"
|
7 |
+
style="
|
8 |
+
position: fixed;
|
9 |
+
top: 0px;
|
10 |
+
bottom: 0px;
|
11 |
+
right: 0px;
|
12 |
+
width: 100%;
|
13 |
+
border: none;
|
14 |
+
margin: 0;
|
15 |
+
padding: 0;
|
16 |
+
overflow: hidden;
|
17 |
+
z-index: 999999;
|
18 |
+
height: 100%;
|
19 |
+
">
|
20 |
+
</iframe>
|
21 |
+
"""
|
22 |
+
|
23 |
+
def main():
|
24 |
+
demo = gr.Interface(
|
25 |
+
fn=run,
|
26 |
+
inputs=[],
|
27 |
+
outputs=gr.HTML(html),
|
28 |
+
)
|
29 |
+
|
30 |
+
demo.launch()
|
31 |
+
|
32 |
+
if __name__ == "__main__":
|
33 |
+
main()
|