Spaces:
Runtime error
Runtime error
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
import os
|
3 |
+
|
4 |
+
url = os.environ['IP_ADDRESS']
|
5 |
+
|
6 |
+
with gr.Blocks() as demo:
|
7 |
+
gr.HTML(
|
8 |
+
"""
|
9 |
+
|
10 |
+
<!DOCTYPE html>
|
11 |
+
<html lang="zh">
|
12 |
+
<head>
|
13 |
+
<meta charset="UTF-8">
|
14 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
15 |
+
<title>En3D</title>
|
16 |
+
<style>
|
17 |
+
body {font-family: Arial, sans-serif;
|
18 |
+
text-align: center;
|
19 |
+
}
|
20 |
+
|
21 |
+
header, section, footer {
|
22 |
+
margin-bottom: 10px;
|
23 |
+
}
|
24 |
+
iframe {
|
25 |
+
width: 80%;
|
26 |
+
height: 1000px;
|
27 |
+
align-items: center;
|
28 |
+
border: none;
|
29 |
+
}
|
30 |
+
</style>
|
31 |
+
</head>
|
32 |
+
<body>
|
33 |
+
<iframe src=""" + url + """ title="demo"></iframe>
|
34 |
+
</section>
|
35 |
+
</body>
|
36 |
+
</html>""")
|
37 |
+
|
38 |
+
if __name__ == "__main__":
|
39 |
+
demo.queue(max_size=100)
|
40 |
+
demo.launch(share=False)
|
41 |
+
|