Skip to content

Commit

Permalink
Added os.path.expandvars to resolve path using environment variables
Browse files Browse the repository at this point in the history
  • Loading branch information
William-N-Havard committed Jul 31, 2024
1 parent 749f3fe commit 11b72ca
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fairseq/data/audio/raw_audio_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ def __init__(
self.skipped_indices = set()

with open(manifest_path, "r") as f:
self.root_dir = f.readline().strip()
self.root_dir = os.path.expandvars(f.readline().strip())
for i, line in enumerate(f):
items = line.strip().split("\t")
assert len(items) == 2, line
Expand Down Expand Up @@ -379,7 +379,7 @@ def __init__(
root_path = os.path.join(data_dir, f"{split}.root")
if os.path.exists(root_path):
with open(root_path, "r") as f:
self.root_dir = next(f).strip()
self.root_dir = os.path.expandvars(next(f).strip())
else:
self.root_dir = None

Expand Down

0 comments on commit 11b72ca

Please sign in to comment.