Skip to content

Commit ff763c5

Browse files
committed
Merge branch 'yolo-achievement'
2 parents aa44f0a + 387b8d6 commit ff763c5

3 files changed

Lines changed: 37 additions & 5 deletions

File tree

.github/workflows/pipeline.yml

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,11 @@ jobs:
2626
python -m pip install --upgrade pip
2727
pip install -r requirements.txt
2828
- name: Upload raw engine dataset to Hugging Face
29+
env:
30+
HF_TOKEN: ${{ secrets.HF_TOKEN }}
31+
HF_DATASET_REPO: ${{ secrets.HF_DATASET_REPO }}
2932
run: |
30-
python src/data_register.py
33+
cd src && python data_register.py
3134
3235
data-prep:
3336
needs: register-dataset
@@ -46,8 +49,11 @@ jobs:
4649
python -m pip install --upgrade pip
4750
pip install -r requirements.txt
4851
- name: Run data preparation (cleaning, splitting, upload)
52+
env:
53+
HF_TOKEN: ${{ secrets.HF_TOKEN }}
54+
HF_DATASET_REPO: ${{ secrets.HF_DATASET_REPO }}
4955
run: |
50-
python src/data_prep.py
56+
cd src && python data_prep.py
5157
5258
model-training:
5359
needs: data-prep
@@ -67,8 +73,12 @@ jobs:
6773
python -m pip install --upgrade pip
6874
pip install -r requirements.txt
6975
- name: Train model with MLflow tracking and register to Hugging Face
76+
env:
77+
HF_TOKEN: ${{ secrets.HF_TOKEN }}
78+
HF_DATASET_REPO: ${{ secrets.HF_DATASET_REPO }}
79+
HF_MODEL_REPO: ${{ secrets.HF_MODEL_REPO }}
7080
run: |
71-
python src/train.py
81+
cd src && python train.py
7282
7383
deploy-hosting:
7484
needs: model-training
@@ -87,6 +97,9 @@ jobs:
8797
python -m pip install --upgrade pip
8898
pip install -r requirements.txt
8999
- name: Deploy Streamlit app and Dockerfile to Hugging Face Space
100+
env:
101+
HF_TOKEN: ${{ secrets.HF_TOKEN }}
102+
HF_SPACE_REPO: ${{ secrets.HF_SPACE_REPO }}
90103
run: |
91-
python src/deploy_to_hf.py
104+
cd src && python deploy_to_hf.py
92105

.gitignore

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,15 @@ venv/
1414
ENV/
1515
env/
1616

17+
# Environment variables and secrets
18+
.env
19+
.env.local
20+
.env.*.local
21+
*.env
22+
secrets/
23+
*.key
24+
*.pem
25+
1726
# MLflow
1827
mlruns/
1928
.mlflow/
@@ -48,3 +57,7 @@ Thumbs.db
4857
*.tmp
4958
*.bak
5059
*.cache
60+
61+
# Hugging Face tokens (never commit these!)
62+
**/token*
63+
**/*token*

src/config.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,13 @@
88
set them via environment variables.
99
"""
1010

11-
PROJECT_ROOT = Path(__file__).resolve().parents[1]
11+
# Handle both local execution and GitHub Actions
12+
if Path(__file__).resolve().name == "config.py":
13+
# Running from src/ directory
14+
PROJECT_ROOT = Path(__file__).resolve().parents[1]
15+
else:
16+
# Running as module
17+
PROJECT_ROOT = Path(__file__).resolve().parent.parent
1218

1319
# -------------------------------------------------------------------------
1420
# Data paths

0 commit comments

Comments
 (0)