Skip to content

Commit

Permalink
Fix: Union of dict for python 3.7.
Browse files Browse the repository at this point in the history
  • Loading branch information
Labbeti committed Jan 5, 2024
1 parent dc6e5ed commit dfcdeba
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/aac_datasets/datasets/functional/audiocaps.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,6 @@ def download_audiocaps_dataset(
# Keys: audiocap_id, youtube_id, start_time, caption

def _cast_line(line: Dict[str, Any], audio_format: str) -> Dict[str, Any]:
line = dict(line)
youtube_id = line["youtube_id"]
start_time = line["start_time"]

Expand All @@ -358,7 +357,8 @@ def _cast_line(line: Dict[str, Any], audio_format: str) -> Dict[str, Any]:
start_time = int(start_time)
fname = f"{youtube_id}_{start_time}.{audio_format}"

return line | {"start_time": start_time, "fname": fname}
line.update({"start_time": start_time, "fname": fname})
return line

captions_data = [_cast_line(line, audio_format) for line in captions_data]
download_kwds = {
Expand Down

0 comments on commit dfcdeba

Please sign in to comment.