
    Z j\                         S SK Jr  SSKJr  SSKJr  SSKJr  \" SS9\ " S S	\5      5       5       r\" SS9\ " S
 S\5      5       5       r	\" SS9\ " S S\5      5       5       r
/ SQrg)    )strict   )PreTrainedConfig)RopeParameters)auto_docstringzzai-org/GLM-4.1V-9B-Thinking)
checkpointc                   N   \ rS rSr% SrSrSrSr\\	S'   Sr
\\	S'   S	r\\	S
'   Sr\\	S'   Sr\\-  \	S'   Sr\\	S'   Sr\\	S'   Sr\\\   -  \\\4   -  \	S'   Sr\\\   -  \\\4   -  \	S'   Sr\\	S'   Sr\\	S'   Sr\\\   -  \\\4   -  \	S'   Sr\\	S'   Sr\\	S'   S r\\	S!'   S"rg#)$Glm4vVisionConfig   a  
out_hidden_size (`int`, *optional*, defaults to 4096):
    The output hidden size of the vision model.

Example:

```python
>>> from transformers import Glm4vVisionConfig, Glm4vVisionModel

>>> # Initializing a Glm4vVisionConfig GLM-4.1V-9B style configuration
>>> configuration = Glm4vVisionConfig()

>>> # Initializing a model (with random weights) from the GLM-4.1V-9B configuration
>>> model = Glm4vVisionModel(configuration)

>>> # Accessing the model configuration
>>> configuration = model.config
```glm4v_visionvision_config   depthi   hidden_sizesilu
hidden_actFattention_bias        attention_dropout   	num_headsr   in_channelsiP  
image_size   
patch_sizeh㈵>rms_norm_eps   spatial_merge_sizetemporal_patch_size   out_hidden_size5  intermediate_size{Gz?initializer_range N)__name__
__module____qualname____firstlineno____doc__
model_typebase_config_keyr   int__annotations__r   r   strr   boolr   floatr   r   r   listtupler   r   r   r    r"   r$   r&   __static_attributes__r'       ~/root/GenerationalWealth/GenerationalWealth/venv/lib/python3.13/site-packages/transformers/models/glm4v/configuration_glm4v.pyr
   r
      s    &  J%OE3OKJ ND %(us{(IsK47Jd3i%S/1746Jd3i%S/16L%=>tCy5c?:>OS"s"#u#r7   r
   c                   \  ^  \ rS rSr% SrSrSrS/rSSSSSS	S
.rS/S/4SS/S/4S/S/4S.r	S1r
Sr\\S'   Sr\\S'   Sr\\S'   Sr\\S'   Sr\\S'   Sr\S-  \S'   Sr\\S'   S r\\S!'   S"r\\S#'   S$r\\S%'   S&r\\S''   S(r\\-  \S)'   Sr\\-  S-  \S*'   Sr\S-  \S+'   U 4S, jr S-r!U =r"$ ).Glm4vTextConfigE   a\  
Example:

```python
>>> from transformers import Glm4vTextModel, Glm4vConfig

>>> # Initializing a GLM-4.1V style configuration
>>> configuration = Glm4vConfig()

>>> # Initializing a model from the GLM-4.1V style configuration
>>> model = Glm4vTextModel(configuration)

>>> # Accessing the model configuration
>>> configuration = model.config
```
glm4v_texttext_configpast_key_valuescolwiserowwisecolwise_gather_outputrowwise_split_input)zlayers.*.self_attn.q_projzlayers.*.self_attn.k_projzlayers.*.self_attn.v_projzlayers.*.self_attn.o_projzlayers.*.mlp.gate_up_projzlayers.*.mlp.down_proj	input_idsinputs_embedshidden_statesattention_mask)embed_tokenslayersnormmrope_sectioni P 
vocab_sizer!   r   r#   r$   (   num_hidden_layers    num_attention_headsr   Nnum_key_value_headsr   r   i   max_position_embeddingsr%   r&   r   r   T	use_cacher   r   rope_parameterspad_token_idc                 b   > U R                   c  U R                  U l         [        TU ]  " S0 UD6  g )Nr'   )rP   rO   super__post_init__selfkwargs	__class__s     r8   rW   Glm4vTextConfig.__post_init__z   s-    ##+'+'?'?D$''r7   )rP   )#r(   r)   r*   r+   r,   r-   r.   keys_to_ignore_at_inferencebase_model_tp_planbase_model_pp_planignore_keys_at_rope_validationrK   r/   r0   r   r$   rM   rO   rP   r   r1   rQ   r&   r3   r   rR   r2   r   rS   r   dictrT   rW   r6   __classcell__r[   s   @r8   r:   r:   E   s-     J#O#4"5 &/%.%.%.%<"7 &(9:#%568IJ!"_$56
 '6%6"JK"s"s!!&'t'J#(S(#u#L%It%(us{(48O^d*T18#L#*#( (r7   r:   c                      ^  \ rS rSr% SrSr\\S.rS/r	Sr
\\-  S-  \S'   Sr\\-  S-  \S'   S	r\\S
'   Sr\\S'   Sr\\S'   Sr\\S'   Sr\\S'   Sr\\S'   Sr\\S'   U 4S jrSrU =r$ )Glm4vConfig   aU  
image_start_token_id (`int`, *optional*, defaults to 151339):
    The image start token index to encode the start of image.
image_end_token_id (`int`, *optional*, defaults to 151340):
    The image end token index to encode the end of image.
video_start_token_id (`int`, *optional*, defaults to 151341):
    The video start token index to encode the start of video.
video_end_token_id (`int`, *optional*, defaults to 151342):
    The video end token index to encode the end of video.

```python
>>> from transformers import Glm4vForConditionalGeneration, Glm4vConfig

>>> # Initializing a GLM-4.1V style configuration
>>> configuration = Glm4vConfig()

>>> # Initializing a model from the GLM-4.1V style configuration
>>> model = Glm4vForConditionalGeneration(configuration)

>>> # Accessing the model configuration
>>> configuration = model.config
```glm4v)r   r=   r>   Nr=   r   i/O image_token_idi0O video_token_idi+O image_start_token_idi,O image_end_token_idi-O video_start_token_idi.O video_end_token_idFtie_word_embeddingsc                   > [        U R                  [        5      (       a%  U R                  S   " S0 U R                  D6U l        O'U R                  c  U R                  S   " S0 UD6U l        [        U R                  [        5      (       a%  U R                  S   " S0 U R                  D6U l        O'U R                  c  U R                  S   " S0 UD6U l        [
        TU ]  " S0 UD6  g )Nr   r=   r'   )
isinstancer   ra   sub_configsr=   rV   rW   rX   s     r8   rW   Glm4vConfig.__post_init__   s    d(($//!%!1!1/!B!XTEWEW!XD'!%!1!1/!B!LV!LDd&&--#//>RAQAQRD%#//>HHD''r7   )r=   r   )r(   r)   r*   r+   r,   r-   r
   r:   rq   r]   r=   ra   r   r0   r   rh   r/   ri   rj   rk   rl   rm   rn   r2   rW   r6   rb   rc   s   @r8   re   re      s    . J$5oVK#4"526K((4/648M4**T18 NC  NC  &#&$$ &#&$$ %%( (r7   re   )re   r:   r
   N)huggingface_hub.dataclassesr   configuration_utilsr   modeling_rope_utilsr   utilsr   r
   r:   re   __all__r'   r7   r8   <module>rx      s   ( / 3 1 # 9:%$( %$  ;%$P 9:7(& 7(  ;7(t 9:1(" 1(  ;1(h Br7   