adding the files
Browse files- Makefile +14 -0
- app.py +14 -0
- requirements.txt +4 -0
Makefile
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
install:
|
2 |
+
pip install --upgrade pip &&\
|
3 |
+
pip install -r requirements.txt
|
4 |
+
|
5 |
+
test:
|
6 |
+
python -m pytest -vv *.py dblib
|
7 |
+
|
8 |
+
format:
|
9 |
+
black *.py
|
10 |
+
|
11 |
+
lint:
|
12 |
+
pylint --disable=R,C --ignore-patterns=test_.*?py *.py dblib
|
13 |
+
|
14 |
+
all: install lint test
|
app.py
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from transformers import pipeline
|
2 |
+
import gradio as gr
|
3 |
+
|
4 |
+
model = pipeline("summarization")
|
5 |
+
|
6 |
+
def predict(prompt):
|
7 |
+
summary = model(prompt)[0]["summary_text"]
|
8 |
+
return summary
|
9 |
+
|
10 |
+
with gr.Blocks() as space:
|
11 |
+
textbox = gr.Textbox(placeholder="Enter text block to summarize", lines=4)
|
12 |
+
gr.Interface(fn=predict, inputs=textbox, outputs="text")
|
13 |
+
|
14 |
+
space.launch()
|
requirements.txt
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
gradio
|
2 |
+
transformers
|
3 |
+
tensorflow
|
4 |
+
tf-keras
|