ashandilgith commited on
Commit
97d6538
·
1 Parent(s): e850a5f

first commit of all files

Browse files
Files changed (5) hide show
  1. README.md +6 -1
  2. app.py +17 -0
  3. cicd.yaml +0 -0
  4. makefile +18 -0
  5. requirements.txt +5 -0
README.md CHANGED
@@ -1 +1,6 @@
1
- # huggingfacedemo2
 
 
 
 
 
 
1
+ # Hugging Face MLOps App
2
+
3
+ A simple Hugging Face inference application built with Python.
4
+
5
+ ## 📦 Project Structure
6
+
app.py ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from transformers import pipeline
2
+ import tensorflow as tf
3
+ import gradio as gr
4
+
5
+
6
+ model = pipeline("summarization")
7
+
8
+ def predict(prompt):
9
+ summary = model(prompt)[0]["summary_text"]
10
+ return summary
11
+
12
+
13
+ with gr.Blocks() as demo:
14
+ textbox = gr.Textbox(placeholder = "Enter text block to summarize", lines=4)
15
+ gr.Interface(fn=predict, inputs=textbox, outputs="text")
16
+
17
+ demo.launch()
cicd.yaml ADDED
File without changes
makefile ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ install:
2
+ pip install --upgrade pip &&\
3
+ pip install -r requirements.txt
4
+
5
+
6
+ #test:
7
+ # python -m pytest -vvv --cov=hello --cov=greeting \
8
+ #--cov=smath --cov=web tests
9
+
10
+ # python -m pytest --nbval notebook.ipynb #tests our jupyter notebook
11
+
12
+ #debug:
13
+ # python -m pytest --v --pdb
14
+
15
+ #one-test:
16
+ # spython -m pytest -vv tests/test_greeting.py::test_my_name4
17
+
18
+
requirements.txt ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ transformers
2
+ gradio
3
+ tensorflow
4
+ torch
5
+ tf-keras