Skip to content

Commit

Permalink
reduce_channels
Browse files Browse the repository at this point in the history
  • Loading branch information
LauraGPT committed Jan 23, 2024
1 parent 619fe61 commit 11a0a11
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion funasr/utils/load_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ def load_audio_text_image_video(data_or_path_or_list, fs: int = 16000, audio_fs:
if isinstance(data_or_path_or_list, str) and os.path.exists(data_or_path_or_list): # local file
if data_type is None or data_type == "sound":
data_or_path_or_list, audio_fs = torchaudio.load(data_or_path_or_list)
data_or_path_or_list = data_or_path_or_list[0, :]
if kwargs.get("reduce_channels", True):
data_or_path_or_list = data_or_path_or_list.mean(0)
elif data_type == "text" and tokenizer is not None:
data_or_path_or_list = tokenizer.encode(data_or_path_or_list)
elif data_type == "image": # undo
Expand Down

0 comments on commit 11a0a11

Please sign in to comment.