Spaces:
Runtime error
Mac Local Training Setup
This guide sets up a Mac-friendly Python environment for local DNABERT-2 experiments.
Full DNABERT-2 training can be slow on a Mac, especially on CPU. Start with small smoke tests before running larger jobs.
CSV File Locations
Training scripts should look for sequence CSVs in this order:
data/processed/training/csv_files/
Your current CSV files are in:
training/csv_files/train_with_sequences.csv
training/csv_files/val_with_sequences.csv
training/csv_files/test_with_sequences.csv
That location is supported.
1. Create Virtual Environment
Run this from the project root:
python3 -m venv .venv
2. Activate It
source .venv/bin/activate
Your terminal prompt should now show .venv.
3. Upgrade pip
python -m pip install --upgrade pip
4. Install Requirements
pip install -r training/requirements-mac.txt
5. Check PyTorch Device
python training/check_device.py
Expected output includes one of:
Using device: mps
or:
Using device: cpu
If you see Using device: cpu, the project will still work, but local training will be slow. Use very small smoke tests locally and use a GPU environment for full model training.
6. Check Dataset
Before training, verify the CSV files:
python training/check_dataset.py
This confirms that the sequence and label columns exist, labels are encoded as 0 and 1, sequence values are present, and class balance is reasonable.