diff --git a/.gitignore b/.gitignore index 1507830..10968e5 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,5 @@ test.py *.json *.pth dist/ -*.egg-info/ \ No newline at end of file +*.egg-info/ +.vs \ No newline at end of file diff --git a/README.md b/README.md index 4602c30..ef8fa33 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,20 @@ ## Installation +This project uses **[uv](https://github.com/astral-sh/uv)** for high-performance dependency management. + +```bash +git clone [https://github.com/ekwek1/soprano-factory.git](https://github.com/ekwek1/soprano-factory.git) +cd soprano-factory + +# Install dependencies (CPU) +uv sync + +# Install dependencies (CUDA 12.6) +uv sync --extra gpu + +## Manual Installation + ```bash git clone https://github.com/ekwek1/soprano-factory.git cd soprano-factory diff --git a/config.yaml b/config.yaml new file mode 100644 index 0000000..36bb816 --- /dev/null +++ b/config.yaml @@ -0,0 +1,20 @@ +# Hardware & Reproducibility +device: "cuda:0" +seed: 1337 + +# Learning Rate Schedule +max_lr: 5.0e-4 # Use 5.0e-4 (with dot) to ensure it loads as a float +warmup_ratio: 0.1 +cooldown_ratio: 0.1 + +# Training Dynamics +batch_size: 4 +grad_accum_steps: 1 +seq_len: 1024 +max_steps: 10000 +val_freq: 250 + +# Optimizer & Model Config +betas: [0.9, 0.95] +weight_decay: 0.1 +text_factor: 0.0 # Increase to train on text inputs \ No newline at end of file diff --git a/dataset.py b/dataset.py index 0946e82..a40d2c5 100644 --- a/dataset.py +++ b/dataset.py @@ -1,10 +1,13 @@ import json +import pathlib from torch.utils.data import Dataset class AudioDataset(Dataset): def __init__(self, path): - with open(path, encoding='utf-8') as f: + # Convert string path to Path object if necessary for consistency + self.path = pathlib.Path(path) + with open(self.path, encoding='utf-8') as f: self.dataset = json.load(f) def __len__(self): @@ -12,6 +15,10 @@ class AudioDataset(Dataset): def __getitem__(self, idx): text, audio = self.dataset[idx] + # Format: [STOP][TEXT][START]