Spaces:
Sleeping
Sleeping
Update main.py
Browse files
main.py
CHANGED
|
@@ -16,12 +16,6 @@ app.add_middleware(
|
|
| 16 |
allow_headers=["*"],
|
| 17 |
)
|
| 18 |
|
| 19 |
-
app.mount("/", StaticFiles(directory="static", html=True), name="static")
|
| 20 |
-
|
| 21 |
-
@app.get("/")
|
| 22 |
-
def index() -> FileResponse:
|
| 23 |
-
return FileResponse(path="/app/static/index.html", media_type="text/html")
|
| 24 |
-
|
| 25 |
pipe_flan = pipeline("text2text-generation", model="google/flan-t5-small")
|
| 26 |
|
| 27 |
@app.get("/infer_t5")
|
|
@@ -30,4 +24,12 @@ def infer_t5(input: str):
|
|
| 30 |
return {"output": "Please enter some text."}
|
| 31 |
|
| 32 |
output = pipe_flan(input)
|
| 33 |
-
return {"output": output[0]["generated_text"]}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
allow_headers=["*"],
|
| 17 |
)
|
| 18 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
pipe_flan = pipeline("text2text-generation", model="google/flan-t5-small")
|
| 20 |
|
| 21 |
@app.get("/infer_t5")
|
|
|
|
| 24 |
return {"output": "Please enter some text."}
|
| 25 |
|
| 26 |
output = pipe_flan(input)
|
| 27 |
+
return {"output": output[0]["generated_text"]}
|
| 28 |
+
|
| 29 |
+
|
| 30 |
+
app.mount("/", StaticFiles(directory="static", html=True), name="static")
|
| 31 |
+
|
| 32 |
+
@app.get("/")
|
| 33 |
+
def index() -> FileResponse:
|
| 34 |
+
return FileResponse(path="/app/static/index.html", media_type="text/html")
|
| 35 |
+
|