Spaces:
Sleeping
Sleeping
Update main.py
Browse files
main.py
CHANGED
@@ -5,6 +5,9 @@ from fastapi.staticfiles import StaticFiles
|
|
5 |
|
6 |
app = FastAPI()
|
7 |
|
|
|
|
|
|
|
8 |
pipe_flan = pipeline("text2text-generation", model="google/flan-t5-small")
|
9 |
|
10 |
def t5(input):
|
@@ -22,9 +25,7 @@ def infer_endpoint(data: dict):
|
|
22 |
return result
|
23 |
|
24 |
# Route to render and present the index.html file
|
25 |
-
@app.get("/", response_class=
|
26 |
-
async def index(
|
27 |
-
return
|
28 |
|
29 |
-
# Serve the static files
|
30 |
-
app.mount("/static", StaticFiles(directory="static"), name="static")
|
|
|
5 |
|
6 |
app = FastAPI()
|
7 |
|
8 |
+
# Serve the static files
|
9 |
+
app.mount("/static", StaticFiles(directory="static"), name="static")
|
10 |
+
|
11 |
pipe_flan = pipeline("text2text-generation", model="google/flan-t5-small")
|
12 |
|
13 |
def t5(input):
|
|
|
25 |
return result
|
26 |
|
27 |
# Route to render and present the index.html file
|
28 |
+
@app.get("/", response_class=Response)
|
29 |
+
async def index():
|
30 |
+
return Response(open("/static/index.html").read(), media_type="text/html")
|
31 |
|
|
|
|