File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -13,7 +13,8 @@ Four wrapper of models:
1313MLFlow is used to list all experiments and easily commpare results for several differents configurations and select the bests
1414
1515Optuna is used to optimise parameters. It run a set of experiments with a variation of parameters and select the best configuration
16- maximising the accuraty
16+ maximising the accuracy.
17+
1718
1819
1920The app is dockerised and can be installed launching the command
@@ -27,7 +28,19 @@ docker compose up -d
2728
2829## Access and architecture
2930The application contains alerting system and monitoring on grafana on port 3000
30- MLFLO
31+ APP PORT
32+ MLFLOW 5001
33+ API 5000
34+ GRAFANA 3000
35+ MONGO
36+ PROMETHEUS
37+ LOKI
38+
39+ A loki message and prometheus services are define
40+ Loki message show the new tweets on grafana. New tweets are saved on a Mongo db.
41+ Prometheus send metrics as the number of prediction running.
42+ An alert is send by mail when number of predictions in concurrency are up to 5.
43+ An alert is send when the result of the prediction is too bad, probability < 0.5.
3144
3245## Installation in dev
3346# Install uv (Rust package to fastly install package)
@@ -36,7 +49,7 @@ curl -Ls https://astral.sh/uv/install.sh | bash
3649export PATH=" $HOME /.cargo/bin:$PATH "
3750```
3851
39- # OVH Train with AI train
52+ ## OVH Train with AI train
4053
4154Create an object storage on OVH managed with ovhai cli
4255The secret key is obtain clicking on the user object storage line 'access secret key'
Original file line number Diff line number Diff line change 2323from sklearn .metrics import confusion_matrix , classification_report
2424from sklearn .ensemble import RandomForestClassifier
2525import seaborn as sns
26- from transformers import AutoTokenizer , AutoModelForSequenceClassification , get_linear_schedule_with_warmup
26+ from transformers import AutoTokenizer , AutoModelForSequenceClassification , get_linear_schedule_with_warmup
2727import pandas as pd
2828from skopt import BayesSearchCV , gp_minimize
2929from skopt .space import Real , Categorical
@@ -420,7 +420,7 @@ def load_checkpoint(self):
420420 if dist .is_available () and dist .is_initialized ():
421421 self .parralle_model ()
422422
423- self .optimizer = torch .optim .Adam (self .model .parameters (), lr = self .lr )
423+ self .optimizer = torch .optim .AdamW (self .model .parameters (), lr = self .lr )
424424 total_steps = len (self .dataloader ) * self .epoch
425425 self .scheduler = get_linear_schedule_with_warmup (
426426 self .optimizer ,
You can’t perform that action at this time.
0 commit comments