class_docstr: This is the configuration class to store the configuration of an [`MusicgenDecoder`]. It is used to instantiate a
  MusicGen decoder according to the specified arguments, defining the model architecture. Instantiating a
  configuration with the defaults will yield a similar configuration to that of the MusicGen
  [facebook/musicgen-small](https://huggingface.co/facebook/musicgen-small) architecture.
  
  Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
  documentation from [`PretrainedConfig`] for more information.
  
  
  Args:
      vocab_size (`int`, *optional*, defaults to 2048):
          Vocabulary size of the MusicgenDecoder model. Defines the number of different tokens that can be
          represented by the `inputs_ids` passed when calling [`MusicgenDecoder`].
      hidden_size (`int`, *optional*, defaults to 1024):
          Dimensionality of the layers and the pooler layer.
      num_hidden_layers (`int`, *optional*, defaults to 24):
          Number of decoder layers.
      num_attention_heads (`int`, *optional*, defaults to 16):
          Number of attention heads for each attention layer in the Transformer block.
      ffn_dim (`int`, *optional*, defaults to 4096):
          Dimensionality of the "intermediate" (often named feed-forward) layer in the Transformer block.
      activation_function (`str` or `function`, *optional*, defaults to `"gelu"`):
          The non-linear activation function (function or string) in the decoder and pooler. If string, `"gelu"`,
          `"relu"`, `"silu"` and `"gelu_new"` are supported.
      dropout (`float`, *optional*, defaults to 0.1):
          The dropout probability for all fully connected layers in the embeddings, text_encoder, and pooler.
      attention_dropout (`float`, *optional*, defaults to 0.0):
          The dropout ratio for the attention probabilities.
      activation_dropout (`float`, *optional*, defaults to 0.0):
          The dropout ratio for activations inside the fully connected layer.
      max_position_embeddings (`int`, *optional*, defaults to 2048):
          The maximum sequence length that this model might ever be used with. Typically, set this to something large
          just in case (e.g., 512 or 1024 or 2048).
      initializer_factor (`float`, *optional*, defaults to 0.02):
          The standard deviation of the truncated_normal_initializer for initializing all weight matrices.
      layerdrop (`float`, *optional*, defaults to 0.0):
          The LayerDrop probability for the decoder. See the [LayerDrop paper](see https://arxiv.org/abs/1909.11556)
          for more details.
      scale_embedding (`bool`, *optional*, defaults to `False`):
          Scale embeddings by diving by sqrt(hidden_size).
      use_cache (`bool`, *optional*, defaults to `True`):
          Whether the model should return the last key/values attentions (not used by all models)
      num_codebooks (`int`, *optional*, defaults to 4):
          The number of parallel codebooks forwarded to the model.
      tie_word_embeddings(`bool`, *optional*, defaults to `False`):
          Whether input and output word embeddings should be tied.
      audio_channels (`int`, *optional*, defaults to 1
          Number of channels in the audio data. Either 1 for mono or 2 for stereo. Stereo models generate a separate
          audio stream for the left/right output channels. Mono models generate a single audio stream output.
class_docstr_tok: ["This","is","the","configuration","class","to","store","the","configuration","of","an","[","`","MusicgenDecoder","`","]",".","It","is","used","to","instantiate","a","MusicGen","decoder","according","to","the","specified","arguments",",","defining","the","model","architecture",".","Instantiating","a","configuration","with","the","defaults","will","yield","a","similar","configuration","to","that","of","the","MusicGen","[","facebook\/musicgen-small","]","(","https",":","\/\/huggingface.co\/facebook\/musicgen-small",")","architecture",".","Configuration","objects","inherit","from","[","`","PretrainedConfig","`","]","and","can","be","used","to","control","the","model","outputs",".","Read","the","documentation","from","[","`","PretrainedConfig","`","]","for","more","information",".","Args",":","vocab_size","(","`","int","`",",","*","optional","*",",","defaults","to","2048",")",":","Vocabulary","size","of","the","MusicgenDecoder","model",".","Defines","the","number","of","different","tokens","that","can","be","represented","by","the","`","inputs_ids","`","passed","when","calling","[","`","MusicgenDecoder","`","]",".","hidden_size","(","`","int","`",",","*","optional","*",",","defaults","to","1024",")",":","Dimensionality","of","the","layers","and","the","pooler","layer",".","num_hidden_layers","(","`","int","`",",","*","optional","*",",","defaults","to","24",")",":","Number","of","decoder","layers",".","num_attention_heads","(","`","int","`",",","*","optional","*",",","defaults","to","16",")",":","Number","of","attention","heads","for","each","attention","layer","in","the","Transformer","block",".","ffn_dim","(","`","int","`",",","*","optional","*",",","defaults","to","4096",")",":","Dimensionality","of","the","``","intermediate","''","(","often","named","feed-forward",")","layer","in","the","Transformer","block",".","activation_function","(","`","str","`","or","`","function","`",",","*","optional","*",",","defaults","to","`","``","gelu","''","`",")",":","The","non-linear","activation","function","(","function","or","string",")","in","the","decoder","and","pooler",".","If","string",",","`","``","gelu","''","`",",","`","``","relu","''","`",",","`","``","silu","''","`","and","`","``","gelu_new","''","`","are","supported",".","dropout","(","`","float","`",",","*","optional","*",",","defaults","to","0.1",")",":","The","dropout","probability","for","all","fully","connected","layers","in","the","embeddings",",","text_encoder",",","and","pooler",".","attention_dropout","(","`","float","`",",","*","optional","*",",","defaults","to","0.0",")",":","The","dropout","ratio","for","the","attention","probabilities",".","activation_dropout","(","`","float","`",",","*","optional","*",",","defaults","to","0.0",")",":","The","dropout","ratio","for","activations","inside","the","fully","connected","layer",".","max_position_embeddings","(","`","int","`",",","*","optional","*",",","defaults","to","2048",")",":","The","maximum","sequence","length","that","this","model","might","ever","be","used","with",".","Typically",",","set","this","to","something","large","just","in","case","(","e.g.",",","512","or","1024","or","2048",")",".","initializer_factor","(","`","float","`",",","*","optional","*",",","defaults","to","0.02",")",":","The","standard","deviation","of","the","truncated_normal_initializer","for","initializing","all","weight","matrices",".","layerdrop","(","`","float","`",",","*","optional","*",",","defaults","to","0.0",")",":","The","LayerDrop","probability","for","the","decoder",".","See","the","[","LayerDrop","paper","]","(","see","https",":","\/\/arxiv.org\/abs\/1909.11556",")","for","more","details",".","scale_embedding","(","`","bool","`",",","*","optional","*",",","defaults","to","`","False","`",")",":","Scale","embeddings","by","diving","by","sqrt","(","hidden_size",")",".","use_cache","(","`","bool","`",",","*","optional","*",",","defaults","to","`","True","`",")",":","Whether","the","model","should","return","the","last","key\/values","attentions","(","not","used","by","all","models",")","num_codebooks","(","`","int","`",",","*","optional","*",",","defaults","to","4",")",":","The","number","of","parallel","codebooks","forwarded","to","the","model",".","tie_word_embeddings","(","`","bool","`",",","*","optional","*",",","defaults","to","`","False","`",")",":","Whether","input","and","output","word","embeddings","should","be","tied",".","audio_channels","(","`","int","`",",","*","optional","*",",","defaults","to","1","Number","of","channels","in","the","audio","data",".","Either","1","for","mono","or","2","for","stereo",".","Stereo","models","generate","a","separate","audio","stream","for","the","left\/right","output","channels",".","Mono","models","generate","a","single","audio","stream","output","."]
code: def __init__(
      self,
      vocab_size=2048,
      max_position_embeddings=2048,
      num_hidden_layers=24,
      ffn_dim=4096,
      num_attention_heads=16,
      layerdrop=0.0,
      use_cache=True,
      activation_function="gelu",
      hidden_size=1024,
      dropout=0.1,
      attention_dropout=0.0,
      activation_dropout=0.0,
      initializer_factor=0.02,
      scale_embedding=False,
      num_codebooks=4,
      audio_channels=1,
      pad_token_id=2048,
      bos_token_id=2048,
      eos_token_id=None,
      tie_word_embeddings=False,
      **kwargs,
  ):
      self.vocab_size = vocab_size
      self.max_position_embeddings = max_position_embeddings
      self.hidden_size = hidden_size
      self.ffn_dim = ffn_dim
      self.num_hidden_layers = num_hidden_layers
      self.num_attention_heads = num_attention_heads
      self.dropout = dropout
      self.attention_dropout = attention_dropout
      self.activation_dropout = activation_dropout
      self.activation_function = activation_function
      self.initializer_factor = initializer_factor
      self.layerdrop = layerdrop
      self.use_cache = use_cache
      self.scale_embedding = (
          scale_embedding  # scale factor will be sqrt(d_model) if True
      )
      self.num_codebooks = num_codebooks
  
      if audio_channels not in [1, 2]:
          raise ValueError(
              f"Expected 1 (mono) or 2 (stereo) audio channels, got {audio_channels} channels."
          )
      self.audio_channels = audio_channels
  
      super().__init__(
          pad_token_id=pad_token_id,
          bos_token_id=bos_token_id,
          eos_token_id=eos_token_id,
          tie_word_embeddings=tie_word_embeddings,
          **kwargs,
      )
  
file_path: transformers/src/transformers/models/musicgen/configuration_musicgen.py
imports: from ...configuration_utils import PretrainedConfig
  from ...utils import logging
  from ..auto.configuration_auto import AutoConfig
label_desc: Use image node_id 1 to create a new MusicgenDecoderConfig object from inherited base classes: PretrainedConfig with example: obj = MusicgenDecoderConfig(vocab_size, max_position_embeddings, num_hidden_layers, ffn_dim, num_attention_heads, layerdrop, use_cache, activation_function, hidden_size, dropout, attention_dropout, activation_dropout, initializer_factor, scale_embedding, num_codebooks, audio_channels, pad_token_id, bos_token_id, eos_token_id, tie_word_embeddings)