class_docstr: Pipeline for text-to-audio generation using MusicLDM.
  
  This model inherits from [`DiffusionPipeline`]. Check the superclass documentation for the generic methods
  implemented for all pipelines (downloading, saving, running on a particular device, etc.).
  
  Args:
      vae ([`AutoencoderKL`]):
          Variational Auto-Encoder (VAE) model to encode and decode images to and from latent representations.
      text_encoder ([`~transformers.ClapModel`]):
          Frozen text-audio embedding model (`ClapTextModel`), specifically the
          [laion/clap-htsat-unfused](https://huggingface.co/laion/clap-htsat-unfused) variant.
      tokenizer ([`PreTrainedTokenizer`]):
          A [`~transformers.RobertaTokenizer`] to tokenize text.
      feature_extractor ([`~transformers.ClapFeatureExtractor`]):
          Feature extractor to compute mel-spectrograms from audio waveforms.
      unet ([`UNet2DConditionModel`]):
          A `UNet2DConditionModel` to denoise the encoded audio latents.
      scheduler ([`SchedulerMixin`]):
          A scheduler to be used in combination with `unet` to denoise the encoded audio latents. Can be one of
          [`DDIMScheduler`], [`LMSDiscreteScheduler`], or [`PNDMScheduler`].
      vocoder ([`~transformers.SpeechT5HifiGan`]):
          Vocoder of class `SpeechT5HifiGan`.
code: def score_waveforms(
      self, text, audio, num_waveforms_per_prompt, device, dtype
  ):
      if not is_librosa_available():
          logger.info(
              "Automatic scoring of the generated audio waveforms against the input prompt text requires the "
              "`librosa` package to resample the generated waveforms. Returning the audios in the order they were "
              "generated. To enable automatic scoring, install `librosa` with: `pip install librosa`."
          )
          return audio
      inputs = self.tokenizer(text, return_tensors="pt", padding=True)
      resampled_audio = librosa.resample(
          audio.numpy(),
          orig_sr=self.vocoder.config.sampling_rate,
          target_sr=self.feature_extractor.sampling_rate,
      )
      inputs["input_features"] = self.feature_extractor(
          list(resampled_audio),
          return_tensors="pt",
          sampling_rate=self.feature_extractor.sampling_rate,
      ).input_features.type(dtype)
      inputs = inputs.to(device)
  
      # compute the audio-text similarity score using the CLAP model
      logits_per_text = self.text_encoder(**inputs).logits_per_text
      # sort by the highest matching generations per prompt
      indices = torch.argsort(logits_per_text, dim=1, descending=True)[
          :, :num_waveforms_per_prompt
      ]
      audio = torch.index_select(audio, 0, indices.reshape(-1).cpu())
      return audio
  
imports: import inspect
  from typing import Any, Callable, Dict, List, Optional, Union
  import numpy
  import torch
  from transformers import ClapFeatureExtractor, ClapModel, ClapTextModelWithProjection, RobertaTokenizer, RobertaTokenizerFast, SpeechT5HifiGan
  from ...models import AutoencoderKL, UNet2DConditionModel
  from ...schedulers import KarrasDiffusionSchedulers
  from ...utils import is_accelerate_available, is_accelerate_version, is_librosa_available, logging, replace_example_docstring
  from ...utils.torch_utils import randn_tensor
  from ..pipeline_utils import AudioPipelineOutput, DiffusionPipeline
label_desc: Use image node_id 6 for calling the MusicLDMPipeline obj's underlying member method code with example usage: obj.score_waveforms(text, audio, num_waveforms_per_prompt, device, dtype) and returns: audio, audio