Spaces:
Runtime error
Runtime error
Update default sample rate
Browse files- dataset.py +1 -1
- train.py +3 -3
dataset.py
CHANGED
@@ -11,8 +11,8 @@ class VoiceDataset(Dataset):
|
|
11 |
self,
|
12 |
data_directory,
|
13 |
transformation,
|
14 |
-
target_sample_rate,
|
15 |
device,
|
|
|
16 |
time_limit_in_secs=5,
|
17 |
):
|
18 |
# file processing
|
|
|
11 |
self,
|
12 |
data_directory,
|
13 |
transformation,
|
|
|
14 |
device,
|
15 |
+
target_sample_rate=48000,
|
16 |
time_limit_in_secs=5,
|
17 |
):
|
18 |
# file processing
|
train.py
CHANGED
@@ -17,7 +17,7 @@ LEARNING_RATE = 0.001
|
|
17 |
|
18 |
TRAIN_FILE="data/train"
|
19 |
TEST_FILE="data/test"
|
20 |
-
SAMPLE_RATE=
|
21 |
|
22 |
def train(model, train_dataloader, loss_fn, optimizer, device, epochs, test_dataloader=None):
|
23 |
training_acc = []
|
@@ -116,8 +116,8 @@ if __name__ == "__main__":
|
|
116 |
n_mels=64
|
117 |
)
|
118 |
|
119 |
-
train_dataset = VoiceDataset(TRAIN_FILE, mel_spectrogram,
|
120 |
-
test_dataset = VoiceDataset(TEST_FILE, mel_spectrogram,
|
121 |
train_dataloader = DataLoader(train_dataset, batch_size=BATCH_SIZE, shuffle=True)
|
122 |
test_dataloader = DataLoader(test_dataset, batch_size=BATCH_SIZE, shuffle=True)
|
123 |
|
|
|
17 |
|
18 |
TRAIN_FILE="data/train"
|
19 |
TEST_FILE="data/test"
|
20 |
+
SAMPLE_RATE=48000
|
21 |
|
22 |
def train(model, train_dataloader, loss_fn, optimizer, device, epochs, test_dataloader=None):
|
23 |
training_acc = []
|
|
|
116 |
n_mels=64
|
117 |
)
|
118 |
|
119 |
+
train_dataset = VoiceDataset(TRAIN_FILE, mel_spectrogram, device)
|
120 |
+
test_dataset = VoiceDataset(TEST_FILE, mel_spectrogram, device)
|
121 |
train_dataloader = DataLoader(train_dataset, batch_size=BATCH_SIZE, shuffle=True)
|
122 |
test_dataloader = DataLoader(test_dataset, batch_size=BATCH_SIZE, shuffle=True)
|
123 |
|