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

# 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

iface = gr.Interface(
    fn=generate_summary,
    inputs="text",
    outputs="text",
    title="Article Summarizer",
    description="Enter an article and get a summary.",
    examples=[
        ["Text of an article goes here..."]
    ]
)
iface.launch()