abubakar-siddik commited on
Commit
bac71bc
Β·
1 Parent(s): 97a33f4

application

Browse files
Files changed (4) hide show
  1. Makefile +22 -0
  2. README.md +3 -1
  3. app.py +15 -0
  4. requirements.txt +3 -0
Makefile ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ install:
2
+ pip install --upgrade pip &&\
3
+ pip install -r requirements.txt
4
+
5
+ test:
6
+ python -m pytest -vv --cov=main --cov=mylib test_*.py
7
+
8
+ format:
9
+ black *.py
10
+
11
+ lint:
12
+ pylint --disable=R,C --ignore-patterns=test_.*?py *.py mylib/*.py
13
+
14
+ container-lint:
15
+ docker run --rm -i hadolint/hadolint < Dockerfile
16
+
17
+ refactor: format lint
18
+
19
+ deploy:
20
+ #deploy goes here
21
+
22
+ all: install lint test format deploy
README.md CHANGED
@@ -1 +1,3 @@
1
- # MLOps-Practice-Repo-1
 
 
 
1
+ # MLOps-Practice-Repo-1
2
+
3
+ source ~/.venv/bin/activate
app.py ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+
13
+ output = gr.Interface(fn=predict, inputs=textbox, outputs="text", title="Text Summarizartion Demo with MLOps Techniques",)
14
+
15
+ output.launch()
requirements.txt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ gradio
2
+ transformers
3
+ tensorflow