Summarization / app.py
jarif's picture
Update app.py
cb2c11c verified
raw
history blame
578 Bytes
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()