Aaron Ponce commited on
Commit ·
2d47ad0
1
Parent(s): 63307b1
revert back to google
Browse files
app.py
CHANGED
|
@@ -6,15 +6,15 @@ from transformers import pipeline
|
|
| 6 |
# of the app. This way, we can use the docs as a landing page for the app on Spaces.
|
| 7 |
app = FastAPI(docs_url="/")
|
| 8 |
|
| 9 |
-
pipe = pipeline("text2text-generation", model="
|
| 10 |
|
| 11 |
|
| 12 |
@app.get("/generate")
|
| 13 |
def generate(text: str):
|
| 14 |
"""
|
| 15 |
Using the text2text-generation pipeline from `transformers`, generate text
|
| 16 |
-
from the given input text. The model used is
|
| 17 |
-
can be found [here](https://huggingface.co/
|
| 18 |
"""
|
| 19 |
output = pipe(text)
|
| 20 |
return {"output": output[0]["generated_text"]}
|
|
|
|
| 6 |
# of the app. This way, we can use the docs as a landing page for the app on Spaces.
|
| 7 |
app = FastAPI(docs_url="/")
|
| 8 |
|
| 9 |
+
pipe = pipeline("text2text-generation", model="google/flan-t5-small")
|
| 10 |
|
| 11 |
|
| 12 |
@app.get("/generate")
|
| 13 |
def generate(text: str):
|
| 14 |
"""
|
| 15 |
Using the text2text-generation pipeline from `transformers`, generate text
|
| 16 |
+
from the given input text. The model used is google/flan-t5-small`, which
|
| 17 |
+
can be found [here](https://huggingface.co/google/flan-t5-small).
|
| 18 |
"""
|
| 19 |
output = pipe(text)
|
| 20 |
return {"output": output[0]["generated_text"]}
|