Roeseler commited on
Commit ·
6c85c8a
1
Parent(s): 1495182
Update app.py
Browse files13 unmodified lines1415161718192013 unmodified lines# The generate() function is defined as a FastAPI route that takes a# string parameter called text. The function generates text based on the # input using the pipeline() object, and returns a JSON response# containing the generated text under the key "output"@app.get("/generate")def generate(text: str):"""Using the text2text-generation pipeline from `transformers`, generate text13 unmodified lines1415161718192013 unmodified lines# The generate() function is defined as a FastAPI route that takes a# string parameter called text. The function generates text based on the # input using the pipeline() object, and returns a JSON response# containing the generated text under the key "output"@app.get("/")def generate(text: str):"""Using the text2text-generation pipeline from `transformers`, generate text
app.py+1-1