arpm01's picture
Update app.py
26b2967
raw
history blame
803 Bytes
import gradio as gr
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM, pipeline
tokenizer = AutoTokenizer.from_pretrained("human-centered-summarization/financial-summarization-pegasus")
model = AutoModelForSeq2SeqLM.from_pretrained("human-centered-summarization/financial-summarization-pegasus")
pipe = pipeline(task="summarization",
model=model,
tokenizer=tokenizer,)
with open('text1.txt') as f:
text1 = f.read()
gr.Interface.from_pipeline(pipe,
title="Financial Summarization",
description="Financial Summarization using Pegasus. Model can be found at https://huggingface.co/human-centered-summarization/financial-summarization-pegasus",
examples=[text1]
).launch()