o
    -iT                     @   s<   d Z ddlmZ ddlmZ ddlmZ G dd deZdS )	zCInference-only HF format GLM-4 model compatible with THUDM weights.    )
VllmConfig)LlamaForCausalLM   )PPMissingLayerc                       s,   e Zd Zdddedef fddZ  ZS )GlmForCausalLM )prefixvllm_configr   c                   s\   |j j}d|jd< t j||d | jjD ]}t|ts+d|j	j
_d |j	j_d|j	j_qd S )Ng      ?partial_rotary_factor)r	   r   FT)model_config	hf_configrope_parameterssuper__init__modellayers
isinstancer   	self_attn
rotary_embis_neox_styleo_projbiasskip_bias_add)selfr	   r   r   layer	__class__ [/home/ubuntu/veenaModal/venv/lib/python3.10/site-packages/vllm/model_executor/models/glm.pyr      s   




zGlmForCausalLM.__init__)__name__
__module____qualname__r   strr   __classcell__r   r   r   r   r      s    $r   N)__doc__vllm.configr    vllm.model_executor.models.llamar   utilsr   r   r   r   r   r   <module>   s
   