Spaces:
Sleeping
Sleeping
Update main.py
Browse files
main.py
CHANGED
|
@@ -4,4 +4,13 @@ app = FastAPI()
|
|
| 4 |
|
| 5 |
@app.get("/")
|
| 6 |
def read_root():
|
| 7 |
-
return {"Hello": "World!"}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 |
+
|
| 13 |
+
@app.get("/infer_t5")
|
| 14 |
+
def t5(input):
|
| 15 |
+
output = pipe_flan(input)
|
| 16 |
+
return {"output": output[0]["generated_text"]}
|