
    -`i
                         d dl mZ d dlmZmZ d dlZd dlmZmZ d dl	m
Z
 d dlmZ d dlmZ ed         Ze e
 ed	
                     G d d                                  ZdS )    )field)AnyLiteralN)
ConfigDictSkipValidation)	dataclass)config)	safe_hash)autocudacputpuxpuT)arbitrary_types_allowedc                   |    e Zd ZU dZdZeeej        z  dz           ed<   	  e	d          Z
eed<   	 defd	Zd
 ZdS )DeviceConfigz7Configuration for the device to use for vLLM execution.r   NdeviceF)initdevice_typereturnc                     g }t          t          |                                          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_strs      f/home/jaya/work/projects/VOICE-AGENT/VIET/agent-env/lib/python3.11/site-packages/vllm/config/device.pycompute_hashzDeviceConfig.compute_hash    s>      S\\0022EJJJTTVV    c                 |   | j         dk    r)ddlm} |j        | _        | j        st	          d          nWt          | j         t                    r| j         | _        n0t          | j         t          j                   r| j         j        | _        | j        dv r	d | _         d S t          j         | j                  | _         d S )Nr   r   )current_platformzFailed to infer device type, please set the environment variable `VLLM_LOGGING_LEVEL=DEBUG` to turn on verbose logging to help debug the issue.)r   )	r   vllm.platformsr#   r   RuntimeError
isinstancer   torchtype)r   r#   s     r   __post_init__zDeviceConfig.__post_init__3   s    ;&  777777/;D# "J   $+s++ 4#';  DK66 4#';#3  w&&DKKK  ,t'788DKKKr!   )__name__
__module____qualname____doc__r   r   Devicer'   __annotations__r   r   r   r    r)    r!   r   r   r      s          BA;AFN6EL0478AAA 
 u%(((K(((c    &9 9 9 9 9r!   r   )dataclassesr   typingr   r   r'   pydanticr   r   pydantic.dataclassesr   vllm.config.utilsr	   vllm.utils.hashingr
   r.   r   r0   r!   r   <module>r7      s                   / / / / / / / / * * * * * * $ $ $ $ $ $ ( ( ( ( ( (	4	5 
**T:::;;;89 89 89 89 89 89 89 <; 89 89 89r!   