Spaces:
Runtime error
Runtime error
EdanMizrahi
commited on
Commit
·
9d7000a
1
Parent(s):
d6fd81b
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
import transformers
|
3 |
+
from transformers import pipeline
|
4 |
+
|
5 |
+
summarizer = pipeline("summarization")
|
6 |
+
|
7 |
+
def summarize(text):
|
8 |
+
return summarizer(text, max_length=200, min_length=30)[0]['summary_text']
|
9 |
+
|
10 |
+
gr.Interface(fn=summarize, inputs=gr.inputs.Textbox(lines=7, placeholder="Enter text here"), outputs="text").launch()
|