Spaces:
Runtime error
Runtime error
Hardeep Arora
commited on
Commit
·
c7c4a55
1
Parent(s):
b1f693e
Initial commit
Browse files- Makefile +23 -0
- app.py +14 -0
- requirements.txt +3 -0
Makefile
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
install:
|
2 |
+
pip install --upgrade pip &&\
|
3 |
+
pip install -r requirements.txt
|
4 |
+
|
5 |
+
run:
|
6 |
+
python app.py
|
7 |
+
|
8 |
+
test:
|
9 |
+
python -m pytest -vvv --cov=hello --cov=greeting \
|
10 |
+
--cov=smath --cov=web tests
|
11 |
+
python -m pytest --nbval notebook.ipynb
|
12 |
+
#python -m pytest tests/test_web.py
|
13 |
+
|
14 |
+
debug:
|
15 |
+
python -m pytest -vv --pdb
|
16 |
+
|
17 |
+
format:
|
18 |
+
black *.py
|
19 |
+
|
20 |
+
lint:
|
21 |
+
pylint --disable=R,C *.py
|
22 |
+
|
23 |
+
all: install lint test format
|
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 demo:
|
11 |
+
textbox = gr.Textbox(placeholder="Enter the text block to summarize", lines=4)
|
12 |
+
gr.Interface(fn=predict, inputs=textbox, outputs="text")
|
13 |
+
|
14 |
+
demo.launch()
|
requirements.txt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
gradio
|
2 |
+
transformers
|
3 |
+
tensorflow
|