code: def get_targets(self, sample, net_output):
      mode = sample["net_input"]["mode"]
      if mode == "unsup_speech":
          return {
              "target_logprobs": net_output[1]["pseudo_target_logprobs"]
          }
      if mode == "sup_speech_ali":
          return net_output[1]["pseudo_target_tokens"]
      return sample["target"]
  
imports: import logging
  from collections import OrderedDict, namedtuple
  from typing import Dict, Optional
  import torch
  import torch.nn
  import torch.nn.functional
  from torch import Tensor
  from fairseq import checkpoint_utils, utils
  from fairseq.file_io import PathManager
  from fairseq.models import FairseqDecoder, FairseqEncoderDecoderModel, register_model, register_model_architecture
  from fairseq.models.speech_to_text import MultiInputDecoder, MultiModalityEncoder, SpeechWavTransformerEncoder, StackedSpeechWavTransformerEncoder
  from fairseq.models.transformer import TransformerDecoder, TransformerEncoder, TransformerModel
label_desc: Use image node_id 4 for calling the SpeechTextPreTrainModel obj's underlying member method code with example usage: obj.get_targets(sample, net_output) and returns: sample, dict, net_output