o
    ÔÙ¾i   ã                   @   sˆ   d dl mZ d dlmZ d dlmZ G dd„ deƒZG dd„ deƒZG dd	„ d	eƒZG d
d„ deƒZ	G dd„ deƒZ
G dd„ deƒZdS )é    )ÚPretrainedConfig)ÚQwen3NextConfig)ÚQwen3VLVisionConfigc                   @   s   e Zd ZdZdZdS )ÚQwen3_5VisionConfigÚqwen3_5Úvision_configN)Ú__name__Ú
__module__Ú__qualname__Ú
model_typeÚbase_config_key© r   r   úN/home/ubuntu/.local/lib/python3.10/site-packages/sglang/srt/configs/qwen3_5.pyr      s    r   c                       s$   e Zd ZdZdZ‡ fdd„Z‡  ZS )ÚQwen3_5TextConfigÚqwen3_5_textÚtext_configc                    s`   |  dd ¡}| d¡d u r|d ur||d< tƒ jdi |¤Ž | jd u r(|p&i | _|p,| j| _d S )NÚrope_parametersÚrope_scalingr   )ÚpopÚgetÚsuperÚ__init__r   r   )ÚselfÚkwargsr   ©Ú	__class__r   r   r      s   

zQwen3_5TextConfig.__init__)r   r	   r
   r   r   r   Ú__classcell__r   r   r   r   r      s    r   c                       sD   e Zd ZdZdZeedœZdgZ								
d‡ fdd„	Z	‡  Z
S )ÚQwen3_5Configac  
    This is the configuration class to store the configuration of a [`Qwen3_5Model`]. It is used to instantiate a
    Qwen3.5 model according to the specified arguments, defining the model architecture. Instantiating a configuration
    with the defaults will yield a similar configuration to that of
    Qwen3.5.

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


    Args:
        text_config (`Union[PreTrainedConfig, dict]`, *optional*, defaults to `Qwen3_5TextConfig`):
            The config object or dictionary of the text backbone.
        vision_config (`Union[PreTrainedConfig, dict]`,  *optional*, defaults to `Qwen3_5VisionConfig`):
            The config object or dictionary of the vision backbone.
        image_token_id (`int`, *optional*, defaults to 151655):
            The image token index to encode the image prompt.
        video_token_id (`int`, *optional*, defaults to 151656):
            The video token index to encode the image prompt.
        vision_start_token_id (`int`, *optional*, defaults to 151652):
            The start token index to encode the image prompt.
        vision_end_token_id (`int`, *optional*, defaults to 151653):
            The end token index to encode the image prompt.
        tie_word_embeddings (`bool`, *optional*, defaults to `False`):
            Whether to tie the word embeddings.

    ```python
    >>> from transformers import Qwen3_5ForConditionalGeneration, Qwen3_5Config

    >>> # Initializing a Qwen3.5 style configuration
    >>> configuration = Qwen3_5Config()

    >>> # Initializing a model from the Qwen3.5 style configuration
    >>> model = Qwen3_5ForConditionalGeneration(configuration)

    >>> # Accessing the model configuration
    >>> configuration = model.config
    ```r   ©r   r   Úpast_key_valuesNégP éhP édP éeP Fc           	         s¦   t |tƒr| jd di |¤Ž| _n|d u r| jd ƒ | _t |tƒr-| jd di |¤Ž| _n|d u r8| jd ƒ | _|| _|| _|| _|| _t	ƒ j
di |¤d|i¤Ž d S )Nr   r   Útie_word_embeddingsr   )Ú
isinstanceÚdictÚsub_configsr   r   Úimage_token_idÚvideo_token_idÚvision_start_token_idÚvision_end_token_idr   r   )	r   r   r   r(   r)   r*   r+   r$   r   r   r   r   r   Q   s   

zQwen3_5Config.__init__)NNr    r!   r"   r#   F)r   r	   r
   Ú__doc__r   r   r   r'   Úkeys_to_ignore_at_inferencer   r   r   r   r   r   r   "   s    'þør   c                   @   ó   e Zd ZdZdS )ÚQwen3_5MoeVisionConfigÚqwen3_5_moeN©r   r	   r
   r   r   r   r   r   r/   m   ó    r/   c                   @   r.   )ÚQwen3_5MoeTextConfigÚqwen3_5_moe_textNr1   r   r   r   r   r3   q   r2   r3   c                   @   s   e Zd ZdZeedœZdS )ÚQwen3_5MoeConfigr0   r   N)r   r	   r
   r   r/   r3   r'   r   r   r   r   r5   u   s
    
þr5   N)Útransformersr   Úsglang.srt.configs.qwen3_nextr   Úsglang.srt.configs.qwen3_vlr   r   r   r   r/   r3   r5   r   r   r   r   Ú<module>   s    K