Spaces:
Runtime error
Runtime error
import gradio as gr | |
from transformers import pipeline | |
# Load your Hugging Face model | |
summarizer = pipeline("summarization", model="Charankarnati18/TASK1") | |
# Define the function to summarize text | |
def summarize_text(text): | |
summary = summarizer(text, max_length=100, min_length=30, do_sample=False) | |
return summary[0]['summary_text'] | |
# Build the Gradio UI | |
interface = gr.Interface( | |
fn=summarize_text, | |
inputs="textbox", | |
outputs="textbox", | |
title="Parent-Child Conversation Summarizer", | |
description="π¬ Paste any Reddit or Chat conversation below, and I will summarize it for you.", | |
) | |
# Launch the web app | |
interface.launch() | |