caobencheng commited on
Commit
1a7a930
·
verified ·
1 Parent(s): b0b7aad

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +5 -4
main.py CHANGED
@@ -1,12 +1,13 @@
1
  from fastapi import FastAPI
 
2
 
3
  app = FastAPI()
4
 
5
- @app.get("/")
6
- def read_root():
7
- return {"Hello": "World!"}
8
 
9
- from transformers import pipeline
 
 
10
 
11
  pipe_flan = pipeline("text2text-generation", model="google/flan-t5-small")
12
 
 
1
  from fastapi import FastAPI
2
+ from transformers import pipeline
3
 
4
  app = FastAPI()
5
 
6
+ app.mount("/", StaticFiles(directory="static", html=True), name="static")
 
 
7
 
8
+ @app.get("/")
9
+ def index() -> FileResponse:
10
+ return FileResponse(path="/app/static/index.html", media_type="text/html")
11
 
12
  pipe_flan = pipeline("text2text-generation", model="google/flan-t5-small")
13