Spaces:
Sleeping
Sleeping
Create app.py
Browse files
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()
|