File size: 652 Bytes
37e6262
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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()