Introduction au contrôle de versions des données avec DVC
Ravi Bhadauria
Machine Learning Engineer
pip $ pip install dvc
$ dvc version
DVC version: 3.40.1 (pip)Platform: Python 3.9.16 on macOS-14.2.1-arm64-arm-64bitConfig: Global: /Users/<username>/Library/Application Support/dvc System: /Library/Application Support/dvcRepo: dvc, git
$ git init
Initialized empty Git repository in /path/to/repo/.git/
$ dvc init
Initialized DVC repository.
You can now commit the changes to git.
$ git status
Changes to be committed:
(use "git rm --cached <file>..." to unstage)
new file: .dvc/.gitignore
new file: .dvc/config
new file: .dvcignore
$ git commit -m "initialized dvc"
Semblable au fichier .gitignore
Utile quand de nombreux fichiers de données ne sont pas requis
# .dvcignore # Ignorer tous les fichiers du répertoire « data » data/*# Mais ne pas ignorer « data/data.csv » !data/data.csv# Ignorer tous les fichiers .tmp *.tmp
dvc check-ignore$ dvc check-ignore data/file.txt
data/file.txt
-d pour les détails$ dvc check-ignore -d data/file.txt
.dvcignore:3:data/* data/file.txt
pip install dvcdvc versiondvc init.dvcignore servent à exclure des fichiers.gitignore, même syntaxedvc check-ignore <filename>Introduction au contrôle de versions des données avec DVC