o
    
۾i                     @   sx   d dl Z d dlmZ d dlmZ d dlmZ e eZ	dZ
dZdZdZdad	ed
eeeg ef f fddZdd ZdS )    N)Callable)Anyzvllm.general_pluginszvllm.io_processor_pluginszvllm.platform_pluginszvllm.stat_logger_pluginsFgroupreturnc           	   	   C   s  ddl m} tj}|| d}t|dkrtd|  i S | tk}|r%tjntj}|d|  |D ]
}|d|j	|j
 q/|d u rB|d tttg tf f  }|D ]1}|d u sZ|j	|v r|d urd|d|j	 z| }|||j	< W qO ty   td	|j	 Y qOw qO|S )
Nr   )entry_pointsr   zNo plugins for group %s found.zAvailable plugins for group %s:z
- %s -> %sz^All plugins in this group will be loaded. Set `VLLM_PLUGINS` to control which plugins to load.zLoading plugin %szFailed to load plugin %s)importlib.metadatar   envsVLLM_PLUGINSlenloggerdebugDEFAULT_PLUGINS_GROUPinfonamevaluedictstrr   r   load	Exception	exception)	r   r   allowed_pluginsdiscovered_pluginsis_default_group	log_levelpluginpluginsfunc r   I/home/ubuntu/.local/lib/python3.10/site-packages/vllm/plugins/__init__.pyload_plugins_by_group   s8   


r    c                  C   s.   t rdS da ttd} |  D ]}|  qdS )zWARNING: plugins can be loaded for multiple times in different
    processes. They should be designed in a way that they can be loaded
    multiple times without causing issues.
    NTr   )plugins_loadedr    r   values)r   r   r   r   r   load_general_pluginsD   s   
r#   )loggingcollections.abcr   typingr   	vllm.envsr	   	getLogger__name__r   r   IO_PROCESSOR_PLUGINS_GROUPPLATFORM_PLUGINS_GROUPSTAT_LOGGER_PLUGINS_GROUPr!   r   r   r    r#   r   r   r   r   <module>   s   
"(