Spaces:
Runtime error
Runtime error
File size: 611 Bytes
eff981f | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | import torch
import gradio as gr
from transformers import pipeline
text_summary = pipeline("summarization", model="sshleifer/distilbart-cnn-12-6", torch_dtype=torch.bfloat16)
def summary (input):
output = text_summary(input)
return output[0]["summary_text"]
gr.close_all()
op = gr.Interface(fn=summary,
inputs= [gr.Textbox(label="Enter the text:",lines=6)],
outputs= [gr.Textbox(label="Summerized Text:", lines=4)],
title="Text Summarizer GenAI Project1",
description = "This is my first project to summarize any data.")
op.launch() |