arpm01's picture
Adding examples
a80dbe8
raw
history blame
625 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,)
gr.Interface.from_pipeline(pipe,
title="financial text2text",
description="Add description",
examples=['text1.txt']
).launch()