text updated on summery model
Browse files15 unmodified lines16171819202122232425262715 unmodified lines@app.get("/generate")def generate(text: str):"""Using the text2text-generation pipeline from `transformers`, summerize textfrom the given input text. The model used is `philschmid/bart-large-cnn-samsum`, whichcan be found [here](<https://huggingface.co/philschmid/bart-large-cnn-samsum>)."""# Use the pipeline to generate text from the given input textoutput = summarizer(conversation)# Return the generated text in a JSON responsereturn {"output": output[0]["summary_text"]}15 unmodified lines16171819202122232425262715 unmodified lines@app.get("/generate")def generate(text: str):"""Using the text summarization pipeline from `transformers`, summerize textfrom the given input text. The model used is `philschmid/bart-large-cnn-samsum`, whichcan be found [here](<https://huggingface.co/philschmid/bart-large-cnn-samsum>)."""# Use the pipeline to generate text from the given input textoutput = summarizer(text)# Return the generated text in a JSON responsereturn {"output": output[0]["summary_text"]}
app.py+2-2