o
    -iw                     @   s   d dl mZmZ d dlmZmZ d dlmZ d dlm	Z	 d dl
mZ d dlmZ er7d dlmZ d dlmZ neZeZeeZe	eG d	d
 d
ZdS )    )TYPE_CHECKINGAny)Fieldfield_validator)	dataclass)config)init_logger)	safe_hash)LoadFormats)TensorizerConfigc                   @   s  e Zd ZU dZdZeeB ed< 	 dZedB ed< 	 dZ	eed< 	 e
edZeeB ed	< 	 dZedB ed
< 	 e
dd dZee eB ed< 	 dZeed< 	 dZeeeef B ed< 	 defddZeddddedefddZeddddee eB dee eB fddZdS )
LoadConfigz,Configuration for loading the model weights.autoload_formatNdownload_dirlazysafetensors_load_strategy)default_factorymodel_loader_extra_configdevicec                   C   s   dgS )Noriginal/**/* r   r   r   M/home/ubuntu/veenaModal/venv/lib/python3.10/site-packages/vllm/config/load.py<lambda>K   s    zLoadConfig.<lambda>ignore_patternsTuse_tqdm_on_loadcpupt_load_map_locationreturnc                 C   s    g }t t| dd }|S )a  
        WARNING: Whenever a new field is added to this config,
        ensure that it is included in the factors list if
        it affects the computation graph.

        Provide a hash that uniquely identifies all the configs
        that affect the structure of the computation
        graph from input ids/embeddings to the final hidden states,
        excluding anything before input ids/embeddings and after
        the final hidden states.
        F)usedforsecurity)r	   strencode	hexdigest)selffactorshash_strr   r   r   compute_hash\   s   zLoadConfig.compute_hashafter)modec                 C   s   |  S )N)lower)clsr   r   r   r   _lowercase_load_formatn   s   z!LoadConfig._lowercase_load_formatc                 C   s&   |dgkrt |dkrtd| |S )Nr   r   z<Ignoring the following patterns when downloading weights: %s)lenloggerinfo)r)   r   r   r   r   _validate_ignore_patternsr   s   z$LoadConfig._validate_ignore_patterns)__name__
__module____qualname____doc__r   r   r
   __annotations__r   r   r   dictr   r   r   r   listr   boolr   r%   r   r*   r.   r   r   r   r   r      s6   
 




r   N)typingr   r   pydanticr   r   pydantic.dataclassesr   vllm.config.utilsr   vllm.loggerr   vllm.utils.hashingr	    vllm.model_executor.model_loaderr
   +vllm.model_executor.model_loader.tensorizerr   r/   r,   r   r   r   r   r   <module>   s   