Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
from transformers import pipeline
|
3 |
+
|
4 |
+
# Load your fine-tuned Hugging Face model
|
5 |
+
summarizer = pipeline("summarization", model="Charankarnati18/TASK1")
|
6 |
+
|
7 |
+
# Define a function to summarize the conversation
|
8 |
+
def summarize_text(text):
|
9 |
+
summary = summarizer(text, max_length=100, min_length=30, do_sample=False)
|
10 |
+
return summary[0]['summary_text']
|
11 |
+
|
12 |
+
# Build the Gradio Web Interface
|
13 |
+
interface = gr.Interface(
|
14 |
+
fn=summarize_text,
|
15 |
+
inputs=gr.Textbox(lines=10, placeholder="Paste the conversation here..."),
|
16 |
+
outputs="text",
|
17 |
+
title="Parent-Child Conversation Summarizer",
|
18 |
+
description="💬 Paste any Reddit or Chat conversation below, and I will summarize it for you.",
|
19 |
+
)
|
20 |
+
|
21 |
+
# Launch the app
|
22 |
+
interface.launch()
|