File size: 1,022 Bytes
63603f7 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# Scripts Directory
This folder contains utility scripts for model preparation and deployment.
## Files
### `prepare_model.py`
Trains the model and generates deployment artifacts.
**Usage:**
```bash
python scripts/prepare_model.py
```
**Output:**
- `model/model.joblib` - Trained model
- `model/config.json` - Model configuration
- `requirements.txt` - Dependencies
- `README.md` - Model card
### `upload_to_hf.py`
Uploads the model and applications to Hugging Face Hub.
**Usage:**
```bash
# Interactive login
python scripts/upload_to_hf.py
# With token
python scripts/upload_to_hf.py --token hf_YOUR_TOKEN
# Upload model only (skip Gradio Space)
python scripts/upload_to_hf.py --token hf_YOUR_TOKEN --no-space
```
**Uploads to:**
- Model repository: `chenhaoq87/MilkSpoilageClassifier`
- Gradio Space: `chenhaoq87/MilkSpoilageClassifier-Demo`
## Workflow
1. Run `prepare_model.py` to train and export the model
2. Run `upload_to_hf.py` to deploy to Hugging Face
|