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