import gradio as gr from transformers import pipeline pipeline = pipeline(task="summarization", model="dross20/summarization_model") def predict(input_text): predictions = pipeline(input_text) return predictions[0]['summary_text'] gradio_app = gr.Interface( predict, inputs = gr.Textbox(label="Enter text to be summarized"), outputs = gr.Textbox(label="Summarized text"), title="Text Summarizer", description="This application performs text summarization using a T5 model fined-tuned on a summarization dataset. Note that this application often takes 30 or more seconds to run." ) if __name__ == "__main__": gradio_app.launch()