Skip to content

Commit

Permalink
minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
JinZr committed Aug 11, 2024
1 parent d0ff7b8 commit 96a5152
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion lhotse/recipes/spatial_librispeech.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@


# Implementation from https://github.com/apple/ml-spatial-librispeech/pull/1/
# Use the requests module to avoid the 403 forbidden error
def download_file(url: str) -> bytes:
"""This function downloads and returns the content of the given url
Args:
Expand Down Expand Up @@ -83,7 +84,7 @@ def _download_spatial_librispeech_audio_files(
continue
recording_path = target_dir / split / f"{sample_id:06}.flac"
recording_url = f"{audio_url}/{sample_id:06}.flac"
if not recording_path.is_file() or force_download:
if not recording_path.exists() or force_download:
file_content = download_file(recording_url)
save_audio_content(recording_path, file_content)

Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,8 @@ def mark_lhotse_version(version: str) -> None:
"pre-commit>=2.17.0,<=2.19.0",
"pandas>2.0.0,<2.3.0",
"pyarrow==17.0.0",
"fastparquet==2024.5.0",
"fastparquet>2023.10.0,<2024.6.0",
"requests==2.31.0",
]
orjson_requires = ["orjson>=3.6.6"]
webdataset_requires = ["webdataset==0.2.5"]
Expand Down

0 comments on commit 96a5152

Please sign in to comment.