Spaces:
Runtime error
Runtime error
Sohailhosseini
commited on
Commit
·
659aa91
1
Parent(s):
255e2a1
codes updated
Browse files- Makefile +4 -0
- app.py +10 -0
- requirements.txt +3 -0
Makefile
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
install:
|
2 |
+
pip install --upgrade pip &&\
|
3 |
+
pip install -r requirements.txt
|
4 |
+
|
app.py
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from transformers import pipeline
|
2 |
+
import gradio as gr
|
3 |
+
|
4 |
+
model = pipeline("summarization")
|
5 |
+
|
6 |
+
def predict(text):
|
7 |
+
return model(text)[0]['summary_text']
|
8 |
+
|
9 |
+
textbox = gr.Textbox(placeholder="Paste your text here to summarize", lines=5)
|
10 |
+
gr.Interface(predict, inputs=textbox, outputs="text").launch()
|
requirements.txt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
gradio
|
2 |
+
transformers
|
3 |
+
tensorflow
|