ServerX commited on
Commit
a1c8378
·
verified ·
1 Parent(s): a812d11

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -19
app.py CHANGED
@@ -1,22 +1,10 @@
1
- import subprocess
2
- import sys
3
- from flask import Flask, send_file
4
- import os
5
 
6
- # Funzione per installare le dipendenze dal file requirements.txt
7
- def install_requirements():
8
- subprocess.check_call([sys.executable, '-m', 'pip', 'install', '-r', 'requirements.txt'])
9
 
10
- # Verifica se i pacchetti necessari sono installati e, in caso contrario, li installa
11
- install_requirements()
12
 
13
- # Crea l'app Flask
14
- app = Flask(__name__)
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)