Charankarnati18 commited on
Commit
37e6262
·
verified ·
1 Parent(s): dbbe0ab

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +22 -0
app.py ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from transformers import pipeline
3
+
4
+ # Load your Hugging Face model
5
+ summarizer = pipeline("summarization", model="Charankarnati18/TASK1")
6
+
7
+ # Define the function to summarize text
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 UI
13
+ interface = gr.Interface(
14
+ fn=summarize_text,
15
+ inputs="textbox",
16
+ outputs="textbox",
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 web app
22
+ interface.launch()