o
    ۷i
                     @   sz   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adedeeeg ef f fd	d
ZdddZg dZdS )    N)Callable)Anyzvllm_omni.general_pluginszvllm_omni.platform_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 i }|D ]1}|d u sQ|j	|v rw|d ur[|d|j	 z| }|||j	< W qF tyv   td	|j	 Y qFw qF|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OMNI_DEFAULT_PLUGINS_GROUPinfonamevalueload	Exception	exception)	r   r   allowed_pluginsdiscovered_pluginsis_default_group	log_levelpluginpluginsfunc r   P/home/ubuntu/vllm_env/lib/python3.10/site-packages/vllm_omni/plugins/__init__.pyload_omni_plugins_by_group   s4   


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   )omni_plugins_loadedr   r   values)r   r   r   r   r   load_omni_general_plugins=   s   
r!   )r!   r   OMNI_PLATFORM_PLUGINS_GROUP)r   N)loggingcollections.abcr   typingr   	vllm.envsr	   	getLogger__name__r   r   r"   r   strdictr   r!   __all__r   r   r   r   <module>   s   
"
%