Add application file
Browse files- Makefile +13 -0
- app.py +14 -0
- requirements.txt +3 -0
Makefile
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
install:
|
2 |
+
pip install - requirements.txt
|
3 |
+
|
4 |
+
test:
|
5 |
+
python -m pytest -vvv --cov=hello --cov=greeting \
|
6 |
+
--cov=smath --cov=web tests
|
7 |
+
python -m pytest --nbval notebook.ipynb
|
8 |
+
|
9 |
+
debug:
|
10 |
+
python -m pytest -vv --pdb
|
11 |
+
|
12 |
+
one-test:
|
13 |
+
python -m pytest -vv tests/test_greeting.py::test_my_name4
|
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 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[gpu]
|