amasiukevich commited on
Commit
bf0ca6d
·
1 Parent(s): 47737df

Resolved the configuration of spaces

Browse files
Files changed (3) hide show
  1. Makefile +17 -0
  2. app.py +17 -0
  3. requirements.txt +3 -0
Makefile ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ install:
2
+ pip install --upgrade pip && pip install -r requirements.txt
3
+
4
+
5
+ test:
6
+ python -m pytest -vvv --cov=hello --cov=greeting \
7
+ --cov=smath --cov=web tests
8
+ python -m pytest --nbval notebook.ipynb #tests the jupyter notebook
9
+
10
+
11
+ debug:
12
+ python -m pytest -vv --pdb # Debugger is invoked
13
+
14
+
15
+ one-test:
16
+ python -m pytest -vv tests/test_greeting.py::test_my_name4
17
+
app.py ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from transformers import pipeline
2
+
3
+ import gradio as gr
4
+
5
+ model = pipeline("summarization")
6
+
7
+ def predict(prompt):
8
+ summary = model(prompt)[0]['summary_text']
9
+ return summary
10
+
11
+
12
+
13
+ textbox = gr.Textbox(placeholder="Enter text block to summarize", lines=4)
14
+ demo = gr.Interface(fn=predict, inputs=textbox, outputs="text")
15
+
16
+
17
+ demo.launch()
requirements.txt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ gradio
2
+ transformers
3
+ tensorflow