Spaces:
Sleeping
Sleeping
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Use a pipeline as a high-level helper
|
2 |
+
from transformers import pipeline
|
3 |
+
import gradio as gr
|
4 |
+
|
5 |
+
pipe = pipeline("summarization", model="sshleifer/distilbart-cnn-12-6")
|
6 |
+
|
7 |
+
def summarize(input):
|
8 |
+
output = pipe(input)
|
9 |
+
return output
|
10 |
+
|
11 |
+
gr.close_all()
|
12 |
+
demo = gr.Interface(fn=summarize, inputs="text", outputs="text")
|
13 |
+
demo.launch(share=True, server_port=int(os.environ['PORT1']))
|