LoicSteve
commited on
Commit
•
a8164b0
1
Parent(s):
9e1a385
first layout
Browse files- Makefile +24 -0
- app.py +13 -0
- requirements.txt +3 -0
Makefile
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
install:
|
2 |
+
pip install --upgrade pip &&\
|
3 |
+
pip install -r requirements.txt
|
4 |
+
|
5 |
+
test:
|
6 |
+
python -m pytest -vvv --cov=hello --cov=gretting \
|
7 |
+
--cov=smath --cov=web tests
|
8 |
+
python -m pytest --nbval notebook.ipynb #tests our notebook
|
9 |
+
#python -m pytest -v tests/test_web.py #if we jusyt want to test web
|
10 |
+
|
11 |
+
debug:
|
12 |
+
python -m pytest -vv --pdb #Debugger is invoked
|
13 |
+
|
14 |
+
one-test:
|
15 |
+
python -m pytest --vv test/test_greeting.py::test_my_name4
|
16 |
+
|
17 |
+
format:
|
18 |
+
black *.py
|
19 |
+
|
20 |
+
|
21 |
+
lint:
|
22 |
+
pylint --disable=R,C hello.py
|
23 |
+
|
24 |
+
all: install lint test format
|
app.py
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
with gr.Blocks() as demo:
|
10 |
+
textbox = gr.Textbox(placeholder="Enter text block to summarize", lines=4)
|
11 |
+
gr.Interface(fn=predict, inputs=textbox, outputs="text")
|
12 |
+
|
13 |
+
demo.launch()
|
requirements.txt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
gradio
|
2 |
+
transformers
|
3 |
+
tensorflow
|