psvkaushik
commited on
Commit
·
bbfb650
unverified
·
0
Parent(s):
Add files via upload
Browse files
app.py
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from transformers import pipeline
|
2 |
+
import gradio as gr
|
3 |
+
|
4 |
+
model = pipeline('summarization')
|
5 |
+
def predict(prompt):
|
6 |
+
output = model(prompt)[0]['summary_text']
|
7 |
+
return output
|
8 |
+
|
9 |
+
with gr as demo:
|
10 |
+
textbox = gr.Textbox(placeholder="Enter the text to summarize", lines=4)
|
11 |
+
gr.Interface(fn=predict, inputs=textbox, outputs='text')
|
12 |
+
|
13 |
+
demo.launch()
|