Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -8,15 +8,13 @@ app = FastAPI()
|
|
8 |
async def root():
|
9 |
return {"message": "Hello World"}
|
10 |
|
11 |
-
|
12 |
-
# NOTE - we configure docs_url to serve the interactive Docs at the root path
|
13 |
# of the app. This way, we can use the docs as a landing page for the app on Spaces.
|
14 |
# app = FastAPI(docs_url="/")
|
15 |
|
16 |
pipe = pipeline("text2text-generation", model="google/flan-t5-small")
|
17 |
|
18 |
-
|
19 |
-
@app.get("/generate")
|
20 |
def generate(text: str):
|
21 |
"""
|
22 |
Using the text2text-generation pipeline from `transformers`, generate text
|
|
|
8 |
async def root():
|
9 |
return {"message": "Hello World"}
|
10 |
|
11 |
+
# NOTE - we configure docs_url to serve the interactive Docs at the root path
|
|
|
12 |
# of the app. This way, we can use the docs as a landing page for the app on Spaces.
|
13 |
# app = FastAPI(docs_url="/")
|
14 |
|
15 |
pipe = pipeline("text2text-generation", model="google/flan-t5-small")
|
16 |
|
17 |
+
@app.get("/generate")
|
|
|
18 |
def generate(text: str):
|
19 |
"""
|
20 |
Using the text2text-generation pipeline from `transformers`, generate text
|