Spaces:
Sleeping
Sleeping
deploy at 2024-08-23 21:50:41.968638
Browse files- main.py +8 -31
- requirements.txt +0 -1
main.py
CHANGED
|
@@ -1,37 +1,14 @@
|
|
| 1 |
from fasthtml_hf import setup_hf_backup
|
| 2 |
from fasthtml.common import *
|
| 3 |
-
#from fastai.vision.all import *
|
| 4 |
-
import
|
|
|
|
| 5 |
|
| 6 |
-
# Create the FastHTML app
|
| 7 |
-
app = FastHTML()
|
| 8 |
|
| 9 |
-
|
| 10 |
-
def get():
|
| 11 |
-
return Div(P('Hello World!'), hx_get="/change")
|
| 12 |
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
# Use this if serve() doesn't work
|
| 17 |
-
# if __name__ == "__main__":
|
| 18 |
-
uvicorn.run("app:app", host="0.0.0.0", port=7860, reload=True)
|
| 19 |
-
|
| 20 |
-
# Alternatively, try using serve() if uvicorn doesn't work
|
| 21 |
-
#serve()
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
# from fasthtml_hf import setup_hf_backup
|
| 25 |
-
# from fasthtml.common import *
|
| 26 |
-
# #from fastai.vision.all import *
|
| 27 |
-
# #import io
|
| 28 |
-
# #import base64
|
| 29 |
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
# @rt('/')
|
| 34 |
-
# def get(): return Div(P('Hello World!'), hx_get="/change")
|
| 35 |
-
|
| 36 |
-
# setup_hf_backup(app)
|
| 37 |
-
# serve()
|
|
|
|
| 1 |
from fasthtml_hf import setup_hf_backup
|
| 2 |
from fasthtml.common import *
|
| 3 |
+
#from fastai.vision.all import *
|
| 4 |
+
#import io
|
| 5 |
+
#import base64
|
| 6 |
|
|
|
|
|
|
|
| 7 |
|
| 8 |
+
app,rt = fast_app()
|
|
|
|
|
|
|
| 9 |
|
| 10 |
+
@rt('/')
|
| 11 |
+
def get(): return Div(P('Hello World!'), hx_get="/change")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
|
| 13 |
+
setup_hf_backup(app)
|
| 14 |
+
serve()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
requirements.txt
CHANGED
|
@@ -1,4 +1,3 @@
|
|
| 1 |
fastai==2.7.16
|
| 2 |
python-fasthtml
|
| 3 |
fasthtml-hf
|
| 4 |
-
uvicorn
|
|
|
|
| 1 |
fastai==2.7.16
|
| 2 |
python-fasthtml
|
| 3 |
fasthtml-hf
|
|
|