text updated on summery model
Browse files
app.py
CHANGED
|
@@ -16,12 +16,12 @@ summarizer = pipeline("summarization", model="philschmid/bart-large-cnn-samsum")
|
|
| 16 |
@app.get("/generate")
|
| 17 |
def generate(text: str):
|
| 18 |
"""
|
| 19 |
-
Using the
|
| 20 |
from the given input text. The model used is `philschmid/bart-large-cnn-samsum`, which
|
| 21 |
can be found [here](<https://huggingface.co/philschmid/bart-large-cnn-samsum>).
|
| 22 |
"""
|
| 23 |
# Use the pipeline to generate text from the given input text
|
| 24 |
-
output = summarizer(
|
| 25 |
|
| 26 |
# Return the generated text in a JSON response
|
| 27 |
return {"output": output[0]["summary_text"]}
|
|
|
|
| 16 |
@app.get("/generate")
|
| 17 |
def generate(text: str):
|
| 18 |
"""
|
| 19 |
+
Using the text summarization pipeline from `transformers`, summerize text
|
| 20 |
from the given input text. The model used is `philschmid/bart-large-cnn-samsum`, which
|
| 21 |
can be found [here](<https://huggingface.co/philschmid/bart-large-cnn-samsum>).
|
| 22 |
"""
|
| 23 |
# Use the pipeline to generate text from the given input text
|
| 24 |
+
output = summarizer(text)
|
| 25 |
|
| 26 |
# Return the generated text in a JSON response
|
| 27 |
return {"output": output[0]["summary_text"]}
|