msbeigi commited on
Commit
b3a835f
·
1 Parent(s): 658e67c

initiate app py

Browse files
Files changed (1) hide show
  1. app.py +14 -0
app.py ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from transformers import pipeline
2
+ import gradio as gr
3
+
4
+ model=pipeline("summarization")
5
+
6
+ def predict(prompt):
7
+ summary=model(prompt)[0]["summary_text"]
8
+ return summary
9
+
10
+ with gr.Blocks() as demo:
11
+ textbox=gr.Textbox("Enter your text to summerize", lines=4)
12
+ gr.Interface(fn=predict,inputs=textbox,outputs="text")
13
+
14
+ demo.launch()