File size: 346 Bytes
7fc4ba1
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
from model import load_model

# Initialize the model
model = load_model()

def summarize_text(input_text: str) -> str:
    """
    Summarize the input text using the pre-trained Hugging Face model.
    """
    # Get the summary
    summary = model(input_text, max_length=200, min_length=50, do_sample=False)
    return summary[0]['summary_text']