stestoni91 commited on
Commit
6105652
1 Parent(s): 8d7609c

Add main file

Browse files
Files changed (1) hide show
  1. app.py +15 -0
app.py ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from transformers import pipeline
2
+ import gradio as gr
3
+
4
+ model = pipeline('summarization')
5
+
6
+ def predict(text):
7
+ summary = model(text)[0]['summary_text']
8
+ return summary
9
+
10
+ with gr.Blocks() as ui:
11
+ textbox = gr.Textbox(placeholder='Enter text to summarize', label='input')
12
+ gr.Interface(fn=predict, inputs=textbox, outputs='text')
13
+
14
+ if __name__ == '__main__':
15
+ ui.launch()