vishalbakshi commited on
Commit
7f44f19
·
verified ·
1 Parent(s): bfb5f52

deploy at 2024-08-23 21:50:41.968638

Browse files
Files changed (2) hide show
  1. main.py +8 -31
  2. 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 * # Uncomment this when you're ready to use fastai
4
- import uvicorn
 
5
 
6
- # Create the FastHTML app
7
- app = FastHTML()
8
 
9
- @app.get('/')
10
- def get():
11
- return Div(P('Hello World!'), hx_get="/change")
12
 
13
- # Set up HuggingFace backup
14
- setup_hf_backup(app)
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
- # app,rt = fast_app()
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