vishalbakshi commited on
Commit
6462d5a
·
verified ·
1 Parent(s): 410dd39

deploy at 2024-08-23 21:28:25.351610

Browse files
Files changed (1) hide show
  1. main.py +33 -9
main.py CHANGED
@@ -1,14 +1,38 @@
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()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  from fasthtml_hf import setup_hf_backup
2
+ from fasthtml.common import FastHTML, Div, P, serve
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
+
25
+ # from fasthtml_hf import setup_hf_backup
26
+ # from fasthtml.common import *
27
+ # #from fastai.vision.all import *
28
+ # #import io
29
+ # #import base64
30
+
31
+
32
+ # app,rt = fast_app()
33
+
34
+ # @rt('/')
35
+ # def get(): return Div(P('Hello World!'), hx_get="/change")
36
+
37
+ # setup_hf_backup(app)
38
+ # serve()