File size: 465 Bytes
90b10ad
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
from fastai.text.all import *
from blurr.text.modeling.all import *
import gradio as gr

# Load the exported model
learn = load_learner('article_highlights.pkl')

def generate_summary(article_text):
    # Perform inference using the loaded model
    summary = learn.blurr_generate_summary(article_text)
    return summary

def main():
    article_text = input()
    summary = generate_summary(article_text)
    print(summary)

if __name__ == "__main__":
    main()