Spaces:
Runtime error
Runtime error
fschwartzer
commited on
Commit
•
a762c55
1
Parent(s):
d2868e1
Create app.py
Browse files- app/app.py +152 -0
app/app.py
ADDED
@@ -0,0 +1,152 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from flask import Flask, render_template_string
|
2 |
+
|
3 |
+
app = Flask(__name__)
|
4 |
+
|
5 |
+
@app.route('/')
|
6 |
+
def index():
|
7 |
+
return render_template_string('''
|
8 |
+
<!DOCTYPE html>
|
9 |
+
<html lang="en">
|
10 |
+
<head>
|
11 |
+
<meta charset="UTF-8">
|
12 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
13 |
+
<title>avalia.se</title>
|
14 |
+
<link href="https://fonts.googleapis.com/css2?family=Quicksand:wght@300;400;500;700&display=swap" rel="stylesheet">
|
15 |
+
<style>
|
16 |
+
body {
|
17 |
+
font-family: 'Quicksand', sans-serif;
|
18 |
+
text-align: center;
|
19 |
+
}
|
20 |
+
.app-link {
|
21 |
+
display: inline-block;
|
22 |
+
margin: 10px;
|
23 |
+
text-decoration: none;
|
24 |
+
}
|
25 |
+
.app-image {
|
26 |
+
width: 150px;
|
27 |
+
height: auto;
|
28 |
+
border: 2px solid transparent;
|
29 |
+
transition: border 0.3s;
|
30 |
+
}
|
31 |
+
.app-image:hover {
|
32 |
+
border: 2px solid #007bff;
|
33 |
+
}
|
34 |
+
.logo {
|
35 |
+
width: 200px;
|
36 |
+
height: auto;
|
37 |
+
margin: 20px 0;
|
38 |
+
}
|
39 |
+
</style>
|
40 |
+
</head>
|
41 |
+
<body>
|
42 |
+
<a href="/"><img src="images_avalia-removebg-preview.PNG" class="logo"></a>
|
43 |
+
<div>
|
44 |
+
<a href="/gradio_app_1" class="app-link">
|
45 |
+
Gradio App 1
|
46 |
+
</a>
|
47 |
+
<a href="/gradio_app_2" class="app-link">
|
48 |
+
Gradio App 2
|
49 |
+
</a>
|
50 |
+
<a href="/streamlit_app" class="app-link">
|
51 |
+
Streamlit App
|
52 |
+
</a>
|
53 |
+
</div>
|
54 |
+
</body>
|
55 |
+
</html>
|
56 |
+
''')
|
57 |
+
|
58 |
+
@app.route('/gradio_app_1')
|
59 |
+
def gradio_app_1():
|
60 |
+
return render_template_string('''
|
61 |
+
<html>
|
62 |
+
<head>
|
63 |
+
<link href="https://fonts.googleapis.com/css2?family=Quicksand:wght@300;400;500;700&display=swap" rel="stylesheet">
|
64 |
+
<style>
|
65 |
+
body {
|
66 |
+
font-family: 'Quicksand', sans-serif;
|
67 |
+
text-align: center;
|
68 |
+
}
|
69 |
+
iframe {
|
70 |
+
border: none;
|
71 |
+
width: 100%;
|
72 |
+
height: 800px;
|
73 |
+
}
|
74 |
+
.logo {
|
75 |
+
width: 200px;
|
76 |
+
height: auto;
|
77 |
+
margin: 20px 0;
|
78 |
+
}
|
79 |
+
</style>
|
80 |
+
</head>
|
81 |
+
<body>
|
82 |
+
<a href="/"><img src="images_avalia-removebg-preview.PNG" alt="AVALIA.SE" class="logo"></a>
|
83 |
+
<h1>Gradio App 1</h1>
|
84 |
+
<iframe src="https://fschwartzer-rl-2.hf.space"></iframe>
|
85 |
+
</body>
|
86 |
+
</html>
|
87 |
+
''')
|
88 |
+
|
89 |
+
@app.route('/gradio_app_2')
|
90 |
+
def gradio_app_2():
|
91 |
+
return render_template_string('''
|
92 |
+
<html>
|
93 |
+
<head>
|
94 |
+
<link href="https://fonts.googleapis.com/css2?family=Quicksand:wght@300;400;500;700&display=swap" rel="stylesheet">
|
95 |
+
<style>
|
96 |
+
body {
|
97 |
+
font-family: 'Quicksand', sans-serif;
|
98 |
+
text-align: center;
|
99 |
+
}
|
100 |
+
iframe {
|
101 |
+
border: none;
|
102 |
+
width: 100%;
|
103 |
+
height: 800px;
|
104 |
+
}
|
105 |
+
.logo {
|
106 |
+
width: 200px;
|
107 |
+
height: auto;
|
108 |
+
margin: 20px 0;
|
109 |
+
}
|
110 |
+
</style>
|
111 |
+
</head>
|
112 |
+
<body>
|
113 |
+
<a href="/"><img src="images_avalia-removebg-preview.PNG" alt="AVALIA.SE" class="logo"></a>
|
114 |
+
<h1>Gradio App 2</h1>
|
115 |
+
<iframe src="https://fschwartzer-bens-moveis-vision.hf.space"></iframe>
|
116 |
+
</body>
|
117 |
+
</html>
|
118 |
+
''')
|
119 |
+
|
120 |
+
@app.route('/streamlit_app')
|
121 |
+
def streamlit_app():
|
122 |
+
return render_template_string('''
|
123 |
+
<html>
|
124 |
+
<head>
|
125 |
+
<link href="https://fonts.googleapis.com/css2?family=Quicksand:wght@300;400;500;700&display=swap" rel="stylesheet">
|
126 |
+
<style>
|
127 |
+
body {
|
128 |
+
font-family: 'Quicksand', sans-serif;
|
129 |
+
text-align: center;
|
130 |
+
}
|
131 |
+
iframe {
|
132 |
+
border: none;
|
133 |
+
width: 100%;
|
134 |
+
height: 800px;
|
135 |
+
}
|
136 |
+
.logo {
|
137 |
+
width: 200px;
|
138 |
+
height: auto;
|
139 |
+
margin: 20px 0;
|
140 |
+
}
|
141 |
+
</style>
|
142 |
+
</head>
|
143 |
+
<body>
|
144 |
+
<a href="/"><img src="images_avalia-removebg-preview.PNG" alt="AVALIA.SE" class="logo"></a>
|
145 |
+
<h1>Streamlit App</h1>
|
146 |
+
<iframe src="https://fschwartzer-geo-dash-tabs.hf.space"></iframe>
|
147 |
+
</body>
|
148 |
+
</html>
|
149 |
+
''')
|
150 |
+
|
151 |
+
if __name__ == '__main__':
|
152 |
+
app.run(debug=False, use_reloader=False)
|