o
    -i                     @   sh   d dl mZ d dlmZ er d dlmZ d dlmZ d dlm	Z	 defddZ
			
				dddZdS )    )TYPE_CHECKING)FastAPI)	Namespace)State)EngineClientappc                 C   s\   ddl m} ddlm} ddlm} ddlm} | | | | | | | | d S )Nr   )router),vllm.entrypoints.pooling.classify.api_routerr   )vllm.entrypoints.pooling.embed.api_router+vllm.entrypoints.pooling.pooling.api_router)vllm.entrypoints.pooling.score.api_routerinclude_router)r   classify_routerembed_routerpooling_routerscore_router r   ^/home/ubuntu/veenaModal/venv/lib/python3.10/site-packages/vllm/entrypoints/pooling/__init__.pyregister_pooling_api_routers   s   


r   engine_clientr   stater   argsr   c              
      sP  ddl m} ddlm} ddlm} ddlm} ddlm	} ddl
m} ddlm  |  I d H }	||j}
|jrA||jd	}nd }t fd
d|	D r^|| |j|	||
|j|j|jdnd |_d|	v rt|| |j||
|j|j|jdnd |_d|	v r|| |j||
|j|j|jdnd |_d|	v sd|	v r|| |j||
|jd|_d S d |_d S )Nr   )load_chat_template)RequestLogger)ServingClassification)OpenAIServingEmbedding)OpenAIServingPooling)ServingScoresPOOLING_TASKS)max_log_lenc                 3   s    | ]}| v V  qd S )Nr   ).0taskr   r   r   	<genexpr>=   s    z%init_pooling_state.<locals>.<genexpr>)supported_tasksrequest_loggerchat_templatechat_template_content_formattrust_request_chat_templatelog_error_stackembed)r%   r&   r'   r(   r)   classifyscore)r%   score_templater)   )vllm.entrypoints.chat_utilsr   vllm.entrypoints.loggerr   )vllm.entrypoints.pooling.classify.servingr   &vllm.entrypoints.pooling.embed.servingr   (vllm.entrypoints.pooling.pooling.servingr   &vllm.entrypoints.pooling.score.servingr   
vllm.tasksr   get_supported_tasksr&   enable_log_requestsr    anyopenai_serving_modelsr'   r(   r)   openai_serving_poolingopenai_serving_embeddingopenai_serving_classificationopenai_serving_scores)r   r   r   r   r   r   r   r   r   r$   resolved_chat_templater%   r   r   r   init_pooling_state   s|   


	r>   N)r   r   r   r   r   r   )typingr   fastapir   argparser   starlette.datastructuresr   vllm.engine.protocolr   r   r>   r   r   r   r   <module>   s   