Judicael Mahoutin DJIDONOU commited on
Commit
8828ac1
·
1 Parent(s): c040006

First commit

Browse files
Files changed (4) hide show
  1. Makefile +25 -0
  2. app.py +14 -0
  3. flagged/log.csv +2 -0
  4. requirements.txt +4 -0
Makefile ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ run:
12
+ python app.py
13
+
14
+ # lint:
15
+ # pylint --disable=R,C --ignore-patterns=test_.*?py *.py mylib/*.py
16
+
17
+ # container-lint:
18
+ # docker run --rm -i hadolint/hadolint < Dockerfile
19
+
20
+ # refactor: format lint
21
+
22
+ # deploy:
23
+ # #deploy goes here
24
+
25
+ # all: install lint test format deploy
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 app:
11
+ textbox= gr.Textbox(placeholder="Entrez le text à resumer ici ", lines=4)
12
+ gr.Interface(fn=predict,inputs=textbox,outputs="text")
13
+
14
+ app.launch()
flagged/log.csv ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ prompt,output,flag,username,timestamp
2
+ "MLOps, short for Machine Learning Operations, is a set of practices designed to create an assembly line for building and running machine learning models. It helps companies automate tasks and deploy models quickly, ensuring everyone involved (data scientists, engineers, IT) can cooperate smoothly and monitor and improve models for better accuracy and performance.","MLOps is a set of practices designed to create an assembly line for building and running machine learning models . it helps companies automate tasks and deploy models quickly, ensuring everyone involved can cooperate smoothly .",,,2024-09-02 12:22:23.108530
requirements.txt ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ gradio
2
+ transformers
3
+ tensorflow
4
+ tf-keras