Skip to content

Commit 8261175

Browse files
committed
documentation
1 parent b10f0d8 commit 8261175

2 files changed

Lines changed: 18 additions & 5 deletions

File tree

README.md

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ Four wrapper of models:
1313
MLFlow is used to list all experiments and easily commpare results for several differents configurations and select the bests
1414

1515
Optuna 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

1920
The app is dockerised and can be installed launching the command
@@ -27,7 +28,19 @@ docker compose up -d
2728

2829
## Access and architecture
2930
The 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
3649
export PATH="$HOME/.cargo/bin:$PATH"
3750
```
3851

39-
# OVH Train with AI train
52+
## OVH Train with AI train
4053

4154
Create an object storage on OVH managed with ovhai cli
4255
The secret key is obtain clicking on the user object storage line 'access secret key'

src/ml.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
from sklearn.metrics import confusion_matrix, classification_report
2424
from sklearn.ensemble import RandomForestClassifier
2525
import 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
2727
import pandas as pd
2828
from skopt import BayesSearchCV, gp_minimize
2929
from 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,

0 commit comments

Comments
 (0)