amanmibra commited on
Commit
85adfed
·
1 Parent(s): 661fd4d

Update default sample rate

Browse files
Files changed (2) hide show
  1. dataset.py +1 -1
  2. 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=16000
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, SAMPLE_RATE, device)
120
- test_dataset = VoiceDataset(TEST_FILE, mel_spectrogram, SAMPLE_RATE, 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
 
 
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