Skip to content

Commit

Permalink
Update data_loader.py
Browse files Browse the repository at this point in the history
  • Loading branch information
sooftware authored Apr 17, 2021
1 parent fbd87af commit 64ebd95
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion kospeech/data/data_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
import threading
import torch
import random

from omegaconf import DictConfig
from torch.utils.data import Dataset

from kospeech.data import load_dataset
from kospeech.utils import logger
from kospeech.data import SpectrogramParser
Expand Down Expand Up @@ -69,6 +69,10 @@ def __init__(
def get_item(self, idx):
""" get feature vector & transcript """
feature = self.parse_audio(os.path.join(self.dataset_path, self.audio_paths[idx]), self.augment_methods[idx])

if feature is None:
return None, None

transcript = self.parse_transcript(self.transcripts[idx])

return feature, transcript
Expand Down

0 comments on commit 64ebd95

Please sign in to comment.