code: def make_padding_masks(src, wav_len=None, pad_idx=0):
      """This method generates the padding masks.
  
      Arguments
      ---------
      src : tensor
          The sequence to the encoder (required).
      wav_len : tensor
          The relative length of the wav given in SpeechBrain format.
      pad_idx : int
          The index for <pad> token (default=0).
  
      Returns
      ---------
      src_key_padding_mask : tensor
          The padding mask.
      """
      src_key_padding_mask = None
      if wav_len is not None:
          abs_len = torch.round(wav_len * src.shape[1])
          src_key_padding_mask = length_to_mask(abs_len).bool()
  
      return src_key_padding_mask
  
imports: import os
  import torch
  import logging
  import pathlib
  from torch import nn
  from huggingface_hub import model_info
  from speechbrain.utils.fetching import fetch
  from speechbrain.dataio.dataio import length_to_mask
  from transformers import AutoConfig, AutoTokenizer, AutoFeatureExtractor, AutoModelForPreTraining, AutoModel, AutoModelWithLMHead, AutoModelForSeq2SeqLM, AutoModelForCausalLM
label_desc: Use image node_id 1 for calling a global function with example usage: make_padding_masks(src, wav_len, pad_idx) and returns: src_key_padding_mask