abidlabs HF Staff commited on
Commit
28087b3
·
verified ·
1 Parent(s): b8136ee

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -0
app.py ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from huggingface_hub import InferenceClient
3
+
4
+
5
+ def summarize(text):
6
+ client = InferenceClient()
7
+
8
+ return client.summarization(
9
+ text,
10
+ model="facebook/bart-large-cnn"
11
+ ).summary_text
12
+
13
+
14
+ with gr.Blocks() as demo:
15
+ t1 = gr.Textbox()
16
+ t2 = gr.Textbox()
17
+ t1.submit(summarize, t1, t2)
18
+
19
+ demo.launch()