Text_Summarize / model.py
dschandra's picture
Create model.py
9e886b1 verified
raw
history blame contribute delete
326 Bytes
from transformers import pipeline
def load_model():
"""
Load the Hugging Face summarization model using the Hugging Face Transformers library.
"""
# Load the pre-trained summarization pipeline from Hugging Face
summarizer = pipeline("summarization", model="facebook/bart-large-cnn")
return summarizer