o
    ZŽhG  ã                   @   s@   d Z ddlmZ ddlmZ e e¡ZG dd„ deƒZdgZ	dS )zPop2Piano model configurationé   )ÚPretrainedConfig)Úloggingc                       sR   e Zd ZdZdZdgZ								
												d‡ fdd„	Z‡  ZS )ÚPop2PianoConfiga“  
    This is the configuration class to store the configuration of a [`Pop2PianoForConditionalGeneration`]. It is used
    to instantiate a Pop2PianoForConditionalGeneration model according to the specified arguments, defining the model
    architecture. Instantiating a configuration with the defaults will yield a similar configuration to that of the
    Pop2Piano [sweetcocoa/pop2piano](https://huggingface.co/sweetcocoa/pop2piano) architecture.

    Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
    documentation from [`PretrainedConfig`] for more information.

    Arguments:
        vocab_size (`int`, *optional*, defaults to 2400):
            Vocabulary size of the `Pop2PianoForConditionalGeneration` model. Defines the number of different tokens
            that can be represented by the `inputs_ids` passed when calling [`Pop2PianoForConditionalGeneration`].
        composer_vocab_size (`int`, *optional*, defaults to 21):
            Denotes the number of composers.
        d_model (`int`, *optional*, defaults to 512):
            Size of the encoder layers and the pooler layer.
        d_kv (`int`, *optional*, defaults to 64):
            Size of the key, query, value projections per attention head. The `inner_dim` of the projection layer will
            be defined as `num_heads * d_kv`.
        d_ff (`int`, *optional*, defaults to 2048):
            Size of the intermediate feed forward layer in each `Pop2PianoBlock`.
        num_layers (`int`, *optional*, defaults to 6):
            Number of hidden layers in the Transformer encoder.
        num_decoder_layers (`int`, *optional*):
            Number of hidden layers in the Transformer decoder. Will use the same value as `num_layers` if not set.
        num_heads (`int`, *optional*, defaults to 8):
            Number of attention heads for each attention layer in the Transformer encoder.
        relative_attention_num_buckets (`int`, *optional*, defaults to 32):
            The number of buckets to use for each attention layer.
        relative_attention_max_distance (`int`, *optional*, defaults to 128):
            The maximum distance of the longer sequences for the bucket separation.
        dropout_rate (`float`, *optional*, defaults to 0.1):
            The ratio for all dropout layers.
        layer_norm_epsilon (`float`, *optional*, defaults to 1e-6):
            The epsilon used by the layer normalization layers.
        initializer_factor (`float`, *optional*, defaults to 1.0):
            A factor for initializing all weight matrices (should be kept to 1.0, used internally for initialization
            testing).
        feed_forward_proj (`string`, *optional*, defaults to `"gated-gelu"`):
            Type of feed forward layer to be used. Should be one of `"relu"` or `"gated-gelu"`.
        use_cache (`bool`, *optional*, defaults to `True`):
            Whether or not the model should return the last key/values attentions (not used by all models).
        dense_act_fn (`string`, *optional*, defaults to `"relu"`):
            Type of Activation Function to be used in `Pop2PianoDenseActDense` and in `Pop2PianoDenseGatedActDense`.
    Z	pop2pianoZpast_key_valuesé`	  é   é   é@   é   é   Né   é    é€   çš™™™™™¹?çíµ ÷Æ°>ç      ð?ú
gated-geluTé    é   Úreluc                    s¶   || _ || _|| _|| _|| _|| _|d ur|n| j| _|| _|	| _|
| _	|| _
|| _|| _|| _|| _|| _| j d¡d dk| _| j| _|| _|| _tƒ jd|||dœ|¤Ž d S )Nú-r   Zgated)Úpad_token_idÚeos_token_idÚis_encoder_decoder© )Ú
vocab_sizeÚcomposer_vocab_sizeÚd_modelÚd_kvÚd_ffÚ
num_layersÚnum_decoder_layersÚ	num_headsÚrelative_attention_num_bucketsÚrelative_attention_max_distanceÚdropout_rateÚlayer_norm_epsilonÚinitializer_factorÚfeed_forward_projÚ	use_cacheÚdense_act_fnÚsplitZis_gated_actZhidden_sizeZnum_attention_headsZnum_hidden_layersÚsuperÚ__init__)Úselfr   r   r   r   r   r   r    r!   r"   r#   r$   r%   r&   r'   r   r(   r   r   r)   Úkwargs©Ú	__class__r   úd/var/www/auris/lib/python3.10/site-packages/transformers/models/pop2piano/configuration_pop2piano.pyr,   K   s6   ý
üzPop2PianoConfig.__init__)r   r   r   r   r	   r
   Nr   r   r   r   r   r   r   TTr   r   r   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__Z
model_typeZkeys_to_ignore_at_inferencer,   Ú__classcell__r   r   r/   r1   r      s0    /ìr   N)
r5   Zconfiguration_utilsr   Úutilsr   Z
get_loggerr2   Úloggerr   Ú__all__r   r   r   r1   Ú<module>   s   

g