§
    jŠtj	  ã                   óX   — d Z ddlmZ ddlmZ  eh d£¦  «        Z G d„ de¦  «        ZdS )z 
Implements ONNX's backend API.
é    )Ú
BackendRep)Ú
RunOptions>   ÚlogidÚlog_severity_levelÚlog_verbosity_levelÚonly_execute_path_to_fetchesc                   ó   — e Zd ZdZd„ Zd„ ZdS )ÚOnnxRuntimeBackendRepz™
    Wraps an :class:`onnxruntime.InferenceSession` to implement ONNX's
    :class:`onnx.backend.base.BackendRep` interface for running predictions.
    c                 ó   — || _         dS )zG
        :param session: :class:`onnxruntime.InferenceSession`
        N)Ú_session)ÚselfÚsessions     ú]/var/www/html/CA-Chatbot/venv/lib/python3.11/site-packages/onnxruntime/backend/backend_rep.pyÚ__init__zOnnxRuntimeBackendRep.__init__    s   € ð  ˆŒˆˆó    c                 óz  ‡
— t          ¦   «         }|                     ¦   «         D ]j\  }}|t          v rt          |||¦  «         Œ t	          ||¦  «        r:t          d|› dd                     t          t          ¦  «        ¦  «        › �¦  «        ‚Œkt          |t          ¦  «        r¢i }t          | j                             ¦   «         ¦  «        D ]\  }}||         ||j        <   Œ| j                             d||¦  «        Š
t          ‰
t          ¦  «        r‰
S d„ | j                             ¦   «         D ¦   «         }	ˆ
fd„|	D ¦   «         S | j                             ¦   «         }t!          |¦  «        dk    r t          dt!          |¦  «        › d	�¦  «        ‚|d
         j        |i}| j                             d||¦  «        S )a«  
        Computes the prediction.
        See :meth:`onnxruntime.InferenceSession.run`.

        :param inputs: a list of input arrays (one per model input) or a single
            array when the model has exactly one input
        :param kwargs: only a safe subset of :class:`onnxruntime.RunOptions` attributes are
            accepted; see ``_ALLOWED_RUN_OPTIONS`` for the list
        :return: list of output arrays
        zRunOptions attribute 'z<' is not permitted via the backend API. Allowed attributes: z, Nc                 ó   — g | ]	}|j         ‘Œ
S © )Úname)Ú.0Úos     r   ú
<listcomp>z-OnnxRuntimeBackendRep.run.<locals>.<listcomp>E   s   € ÐLÐLÐL¨1 ¤ÐLÐLÐLr   c                 ó    •— g | ]
}‰|         ‘ŒS r   r   )r   r   Úoutss     €r   r   z-OnnxRuntimeBackendRep.run.<locals>.<listcomp>F   s   ø€ Ð<Ð<Ð< t˜˜Tœ
Ð<Ð<Ð<r   é   zModel expect z inputsr   )r   ÚitemsÚ_ALLOWED_RUN_OPTIONSÚsetattrÚhasattrÚRuntimeErrorÚjoinÚsortedÚ
isinstanceÚlistÚ	enumerater   Ú
get_inputsr   ÚrunÚget_outputsÚlen)r   ÚinputsÚkwargsÚoptionsÚkÚvÚinpsÚiÚinpÚoutput_namesr   s             @r   r'   zOnnxRuntimeBackendRep.run&   sÕ  ø€ õ ‘,”,ˆØ—L’L‘N”Nð 	ð 	‰DˆAˆqØÕ(Ð(Ð(Ý˜  AÑ&Ô&Ð&Ð&Ý˜ !Ñ$Ô$ð Ý"ðU¨Qð Uð UØ+/¯9ª9µVÕ<PÑ5QÔ5QÑ+RÔ+RðUð Uñô ð ðõ �f�dÑ#Ô#ð 	:ØˆDÝ# D¤M×$<Ò$<Ñ$>Ô$>Ñ?Ô?ð +ð +‘��3Ø!'¨¤��S”X‘�Ø”=×$Ò$ T¨4°Ñ9Ô9ˆDÝ˜$¥Ñ%Ô%ð =Ø�àLÐL°´×0IÒ0IÑ0KÔ0KÐLÑLÔL�Ø<Ð<Ð<Ð<¨|Ð<Ñ<Ô<Ð<à”-×*Ò*Ñ,Ô,ˆCÝ�3‰xŒx˜1Š}ˆ}Ý"Ð#Dµ3°s±8´8Ð#DÐ#DÐ#DÑEÔEÐEØ˜”F”K Ð(ˆDØ”=×$Ò$ T¨4°Ñ9Ô9Ð9r   N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r'   r   r   r   r
   r
      s<   € € € € € ðð ð
 ð  ð  ð&:ð &:ð &:ð &:ð &:r   r
   N)r6   Úonnx.backend.baser   Úonnxruntimer   Ú	frozensetr   r
   r   r   r   ú<module>r:      sŒ   ðð
ð ð )Ð (Ð (Ð (Ð (Ð (à "Ð "Ð "Ð "Ð "Ð "ð
 !�yðð ð ñô Ð ð2:ð 2:ð 2:ð 2:ð 2:˜Jñ 2:ô 2:ð 2:ð 2:ð 2:r   