Spaces:
Sleeping
Sleeping
pgits commited on
Commit ·
8caf3b5
1
Parent(s): 6a37131
removing app.py
Browse files
app.py
DELETED
|
@@ -1,16 +0,0 @@
|
|
| 1 |
-
from fastapi import FastAPI
|
| 2 |
-
from transformers import pipeline
|
| 3 |
-
|
| 4 |
-
app = FastAPI()
|
| 5 |
-
pipe_flan = pipeline("text2text-generation", model="google/flan-t5-small")
|
| 6 |
-
|
| 7 |
-
@app.get("/")
|
| 8 |
-
def greet_json():
|
| 9 |
-
return {"Hello": "World!"}
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
@app.get("/infer_t5")
|
| 14 |
-
def t5(input):
|
| 15 |
-
output = pipe_flan(input)
|
| 16 |
-
return {"output": output[0]["generated_text"]}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|