adding the initial files
Browse files- Makefile +14 -0
- app.py +14 -0
- flagged/log.csv +3 -0
- requirements.txt +3 -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 -vvv --voc=hello --cov=greeting \
|
7 |
+
--cov=smath --cov=web tests
|
8 |
+
python -m pytest --nbval notebook.ipynb #tests our jupyter notebook
|
9 |
+
|
10 |
+
debug:
|
11 |
+
python -m pytest -vv ---pdb #Debugger is invoked
|
12 |
+
|
13 |
+
one-test:
|
14 |
+
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(promp):
|
7 |
+
summary = model(promp)[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()
|
flagged/log.csv
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
promp,output,flag,username,timestamp
|
2 |
+
Debugging in Python is facilitated by pdb module.,,,,2023-12-27 16:28:50.039661
|
3 |
+
Debugging in Python is facilitated by pdb module.,,,,2023-12-27 16:28:51.758243
|
requirements.txt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
gradio
|
2 |
+
transformers
|
3 |
+
tensorflow
|