Spaces:
Sleeping
Sleeping
Delete app.py
Browse files
app.py
DELETED
@@ -1,17 +0,0 @@
|
|
1 |
-
import os
|
2 |
-
from fastapi import FastAPI
|
3 |
-
from transformers import pipeline
|
4 |
-
|
5 |
-
app = FastAPI()
|
6 |
-
|
7 |
-
pipe = pipeline("text2text-generation", model="google/flan-t5-small")
|
8 |
-
|
9 |
-
@app.get("/")
|
10 |
-
def home():
|
11 |
-
return {"message": "Hello World!"}
|
12 |
-
|
13 |
-
@app.get("/generate")
|
14 |
-
def generate(text: str):
|
15 |
-
output = pipe(text)
|
16 |
-
return {"output": output[0]["generated_text"]}
|
17 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|