
    9i3                     X    S r SSKJr  SSKJr  \R                  " 5       r " S S\5      rg)zChatGLM model configuration     )PretrainedConfig)loggerc                   V   ^  \ rS rSrSrSr                 SU 4S jjrSrU =r$ )ChatGLMConfig
   a2	  
This is the configuration class to store the configuration of a [`~ChatGLMModel`].
It is used to instantiate an ChatGLM 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 ChatGLM-6B [THUDM/ChatGLM-6B](https://huggingface.co/THUDM/chatglm-6b) 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 150528):
        Vocabulary size of the ChatGLM-6B model.
        Defines the number of different tokens that can be represented by the
        `inputs_ids` passed when calling [`~ChatGLMModel`] or
        [`~TFChatGLMModel`].
    hidden_size (`int`, *optional*, defaults to 4096):
        Dimension of the encoder layers and the pooler layer.
    num_hidden_layers (`int`, *optional*, defaults to 28):
        Number of hidden layers in the Transformer encoder.
    num_attention_heads (`int`, *optional*, defaults to 32):
        Number of attention heads for each attention layer in the Transformer encoder.
    inner_hidden_size (`int`, *optional*, defaults to 16384):
        Dimension of the "intermediate" (i.e., feed-forward) layer in the Transformer encoder.
    max_sequence_length (`int`, *optional*, defaults to 512):
        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).
    layernorm_epsilon (`float`, *optional*, defaults to 1e-5):
        The epsilon used by the layer normalization layers.
    use_cache (`bool`, *optional*, defaults to `True`):
        Whether the model should return the last key/values attentions (not used by all models).
    Example:

```python
>>> from modelscope.models.nlp.chatglm.configuration import ChatGLMConfig
>>> from modelscope.models.nlp.chatglm.text_generation import ChatGLMModel

>>> # Initializing a ChatGLM-6B THUDM/ChatGLM-6B style configuration
>>> configuration = ChatGLMConfig()

>>> # Initializing a model from the THUDM/ChatGLM-6B style configuration
>>> model = ChatGLMModel(configuration)

>>> # Accessing the model configuration
>>> configuration = model.config
```
chatglmc                    > X0l         Xl        X l        X@l        Xl        XPl        Xl        X`l        Xpl        Xl	        Xl
        Xl        Xl        Xl        Xl        UU l        UU l        ["        TU ]H  " SUUUS.UD6  g )N)pad_token_idbos_token_ideos_token_id )
num_layers
vocab_sizehidden_sizenum_attention_headsmax_sequence_lengthlayernorm_epsiloninner_hidden_size	use_cacher   r   r
   mask_token_idgmask_token_idposition_encoding_2dquantization_bitpre_seq_lenprefix_projectionsuper__init__)selfr   r   r   r   r   r   r   r   r   r   r
   r   r   r   r   r   r   kwargs	__class__s                      k/var/www/html/land-doc-ocr/venv/lib/python3.13/site-packages/modelscope/models/nlp/chatglm/configuration.pyr   ChatGLMConfig.__init__=   s    & %$&#6 #6 !2!2"(((*,$8! 0&!2 	%%%	 		    )r   r   r   r   r   r   r   r   r   r   r
   r   r   r   r   r   r   )i L i          gh㈵>FiI iI iI iI r   i   i @  Tr   NF)	__name__
__module____qualname____firstlineno____doc__
model_typer   __static_attributes____classcell__)r    s   @r!   r   r   
   sO    /` J #!%'#' $$% &%)#(&*"#!#(#) )r#   r   N)r*    transformers.configuration_utilsr   modelscope.utilsr   logging
get_loggerr   r   r#   r!   <module>r2      s+    # = .				\$ \r#   