Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions src/torchaudio/datasets/cmuarctic.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import csv
import os
from pathlib import Path
from typing import Tuple, Union
Expand Down Expand Up @@ -128,9 +127,8 @@ def __init__(
)
self._text = os.path.join(self._path, self._folder_text, self._file_text)

with open(self._text, "r") as text:
walker = csv.reader(text)
self._walker = list(walker)
with open(self._text, "r", newline=None) as text:
self._walker = [[line.rstrip("\n")] for line in text.readlines()]

def __getitem__(self, n: int) -> Tuple[Tensor, int, str, str]:
"""Load the n-th sample from the dataset.
Expand Down
2 changes: 1 addition & 1 deletion test/torchaudio_unittest/datasets/cmuarctic_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def get_mock_dataset(root_dir):
"""
mocked_data = []
sample_rate = 16000
transcript = "This is a test transcript."
transcript = "This is a test transcript, with comma."

base_dir = os.path.join(root_dir, "ARCTIC", "cmu_us_aew_arctic")
txt_dir = os.path.join(base_dir, "etc")
Expand Down
Loading