Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,22 +1,10 @@
|
|
1 |
-
import
|
2 |
-
import sys
|
3 |
-
from flask import Flask, send_file
|
4 |
-
import os
|
5 |
|
6 |
-
|
7 |
-
|
8 |
-
subprocess.check_call([sys.executable, '-m', 'pip', 'install', '-r', 'requirements.txt'])
|
9 |
|
10 |
-
#
|
11 |
-
|
12 |
|
13 |
-
#
|
14 |
-
|
15 |
-
|
16 |
-
@app.route('/')
|
17 |
-
def home():
|
18 |
-
print("Request received, serving index.html")
|
19 |
-
return send_file(os.path.join(os.getcwd(), 'index.html'))
|
20 |
-
|
21 |
-
if __name__ == '__main__':
|
22 |
-
app.run(debug=True)
|
|
|
1 |
+
import gradio as gr
|
|
|
|
|
|
|
2 |
|
3 |
+
def serve_index():
|
4 |
+
return gr.HTML(open("index.html").read())
|
|
|
5 |
|
6 |
+
# Crea una interfaccia con Gradio
|
7 |
+
interface = gr.Interface(fn=serve_index, inputs=[], outputs="html")
|
8 |
|
9 |
+
# Avvia il server
|
10 |
+
interface.launch(debug=True, share=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|