commit 4f967d05ec8b9fcda84a6ca91ec61d8f245c1bd5 Author: ekwek1 Date: Tue Jan 13 07:47:17 2026 -0800 first commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1507830 --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +__pycache__/ +test.py +*.json +*.pth +dist/ +*.egg-info/ \ No newline at end of file diff --git a/dataset.py b/dataset.py new file mode 100644 index 0000000..0946e82 --- /dev/null +++ b/dataset.py @@ -0,0 +1,17 @@ +import json +from torch.utils.data import Dataset + + +class AudioDataset(Dataset): + def __init__(self, path): + with open(path, encoding='utf-8') as f: + self.dataset = json.load(f) + + def __len__(self): + return len(self.dataset) + + def __getitem__(self, idx): + text, audio = self.dataset[idx] + # Format: [STOP][TEXT][START]