ó
    >:jÖ  ã                  ó˜  • S SK Jr  S SKrS SKrS SKrS SKrS SKrS SKrS SKJ	r	  S SK
JrJr  S SKJr  S SKJr  S SKJrJrJr  S SKrS SKJr  S SKrS SKJrJr  S S	KJr  S S
KJr  S SK J!r!  S SK"J#r#  S SK$J%r%  S SK&J'r'  S SK(J)r)  S SK*J+r+J,r,  S SK-J.r.  S SK/J0r0  S SK1J2r2  SSK3J4r4  SSK5J6r6  \Rn                  " \85      r91 Skr: " S S\%\45      r;g)é    )ÚannotationsN)ÚOrderedDict)ÚCallableÚIterator)Úcontextmanager)ÚQueue)ÚAnyÚLiteralÚoverload)ÚTensorÚnn)Útrange)Úlogging)Ú
deprecated)ÚSingleInput)Ú	BaseModel)ÚTransformer)ÚPooling)Úbatch_to_deviceÚtruncate_embeddings)Údeprecated_kwargs)Úquantize_embeddings)ÚSimilarityFunctioné   )ÚFitMixin)Ú SentenceTransformerModelCardData>   Úint8Úuint8ÚbinaryÚfloat32Úubinaryc                  óT  ^ • \ rS rSr% Sr\rSrS\S'   SSS.r	S\S	'   \
" S
S9 S;SSSSSSSSSSSSSSSSSS.                                     S<U 4S jjjj5       r\
" SS9             S=                             S>S jj5       r\
" SS9             S=                             S>S jj5       r\             S?                             S@S jj5       r\             S?                             SAS jj5       r\             S?                             SBS jj5       r\             S?                             SCS jj5       r\             S?                             SDS jj5       r\             S?                             SES jj5       r\             S?                             SFS jj5       r\R"                  " 5       \
" SS9             S=                             S>S jj5       5       r\SGS j5       r\SHS j5       r\R,                      SIS j5       r\SJS j5       r\SKS  j5       r\SLS! j5       r\SJS" j5       r\      SKS# j5       r\  SLS$ j5       r\" S%5              SM                     SNS& jj5       r    SO           SPS' jjr\          SQS( j5       rSRS) jr\" S*5      SSS+ j5       rSTS, jr\" S-\ S.9STS/ j5       r!\"SUS0 j5       r#\"\" S1\ S.9SUS2 j5       5       r$\\" S35      SVS4 j5       5       r%      SW                   SXS5 jjr&SYU 4S6 jjr'SZU 4S7 jjr(       S[                     S\S8 jjr)S]S9 jr*S:r+U =r,$ )^ÚSentenceTransformeré)   aP  
Loads or creates a SentenceTransformer model that can be used to map text and other inputs to dense embeddings.

Args:
    model_name_or_path (str, optional): If a filepath on disk, loads the model from that path. Otherwise, tries
        to download a pre-trained SentenceTransformer model. If that fails, tries to construct a model from
        the Hugging Face Hub with that name. Defaults to None.
    modules (list[nn.Module], optional): A list of torch modules that are called sequentially. Can be used to
        create custom SentenceTransformer models from scratch. Defaults to None.
    device (str, optional): Device (like ``"cuda"``, ``"cpu"``, ``"mps"``, ``"npu"``) that should be used for
        computation. If None, checks if a GPU can be used. Defaults to None.
    prompts (dict[str, str], optional): A dictionary with prompts for the model. The key is the prompt name,
        the value is the prompt text. The prompt text will be prepended before any text to encode. For example:
        ``{"query": "query: ", "passage": "passage: "}``. If a model has saved prompts, you can override
        them by passing your own, or pass ``{"query": "", "document": ""}`` to disable them.
        Defaults to None.
    default_prompt_name (str, optional): The name of the prompt that should be used by default. If not set,
        no prompt will be applied. Defaults to None.
    cache_folder (str, optional): Path to store models. Can also be set by the ``SENTENCE_TRANSFORMERS_HOME``
        environment variable. Defaults to None.
    trust_remote_code (bool, optional): Whether to allow for custom models defined on the Hub in their own
        modeling files. Only set to ``True`` for repositories you trust and in which you have read the code,
        as it will execute code present on the Hub on your local machine. Defaults to False.
    revision (str, optional): The specific model version to use. It can be a branch name, a tag name, or a
        commit id, for a stored model on Hugging Face. Defaults to None.
    local_files_only (bool, optional): Whether to only look at local files (i.e., do not try to download
        the model). Defaults to False.
    token (bool or str, optional): Hugging Face authentication token to download private models.
        Defaults to None.
    use_auth_token (bool or str, optional): Deprecated. Use ``token`` instead.
    model_kwargs (dict[str, Any], optional): Keyword arguments passed to the underlying Hugging Face
        Transformers model via ``AutoModel.from_pretrained``. Particularly useful options include:

        - ``torch_dtype``: Override the default ``torch.dtype`` and load the model under a specific
          dtype. Can be ``torch.float16``, ``torch.bfloat16``, ``torch.float32``, or ``"auto"`` to
          use the dtype from the model's ``config.json``.
        - ``attn_implementation``: The attention implementation to use. For example ``"eager"``,
          ``"sdpa"``, or ``"flash_attention_2"``. If you ``pip install kernels``, then
          ``"flash_attention_2"`` should work without having to install ``flash_attn``. It is
          frequently the fastest option. Defaults to ``"sdpa"`` when available (torch>=2.1.1).
        - ``device_map``: Device map for model parallelism, e.g. ``"auto"``.
        - ``provider``: For ``backend="onnx"``, the ONNX execution provider
          (e.g. ``"CUDAExecutionProvider"``).
        - ``file_name``: For ``backend="onnx"`` or ``"openvino"``, the filename to load
          (e.g. for optimized or quantized models).
        - ``export``: For ``backend="onnx"`` or ``"openvino"``, whether to export the model to the
          backend format. Also set automatically if the exported file doesn't exist.

        See the `PreTrainedModel.from_pretrained
        <https://huggingface.co/docs/transformers/en/main_classes/model#transformers.PreTrainedModel.from_pretrained>`_
        documentation for more details. Defaults to None.
    processor_kwargs (dict[str, Any], optional): Keyword arguments passed to the Hugging Face Transformers
        processor/tokenizer via ``AutoProcessor.from_pretrained``. See the `AutoTokenizer.from_pretrained
        <https://huggingface.co/docs/transformers/en/model_doc/auto#transformers.AutoTokenizer.from_pretrained>`_
        documentation for more details. Defaults to None.
    config_kwargs (dict[str, Any], optional): Keyword arguments passed to the Hugging Face Transformers
        config via ``AutoConfig.from_pretrained``. See the `AutoConfig.from_pretrained
        <https://huggingface.co/docs/transformers/en/model_doc/auto#transformers.AutoConfig.from_pretrained>`_
        documentation for more details. Defaults to None.
    model_card_data (:class:`~sentence_transformers.sentence_transformer.model_card.SentenceTransformerModelCardData`, optional):
        A model card data object that contains information about the model. Used to generate a model card
        when saving the model. If not set, a default model card data object is created. Defaults to None.
    backend (str, optional): The backend to use for inference. Can be ``"torch"`` (default), ``"onnx"``,
        or ``"openvino"``. Defaults to ``"torch"``.
    similarity_fn_name (str or SimilarityFunction, optional): The name of the similarity function to use.
        Valid options are ``"cosine"``, ``"dot"``, ``"euclidean"``, and ``"manhattan"``. If not set, it is
        automatically set to ``"cosine"`` when :attr:`similarity` or :attr:`similarity_pairwise` are first
        accessed. Defaults to None.
    truncate_dim (int, optional): The dimension to truncate sentence embeddings to. ``None`` means no
        truncation. Defaults to None.

Example:
    ::

        from sentence_transformers import SentenceTransformer

        # Load a pre-trained SentenceTransformer model
        model = SentenceTransformer('sentence-transformers/all-mpnet-base-v2')

        # Encode some texts
        sentences = [
            "The weather is lovely today.",
            "It's so sunny outside!",
            "He drove to the stadium.",
        ]
        embeddings = model.encode(sentences)
        print(embeddings.shape)
        # (3, 768)

        # Get the similarity scores between all sentences
        similarities = model.similarity(embeddings, embeddings)
        print(similarities)
        # tensor([[1.0000, 0.6817, 0.0492],
        #         [0.6817, 1.0000, 0.0421],
        #         [0.0492, 0.0421, 1.0000]])
zsentence-transformersú
str | NoneÚ default_huggingface_organizationN)ÚqueryÚdocumentzdict[str, str | None]Ú_default_promptsÚprocessor_kwargs)Útokenizer_kwargsFÚtorch)ÚmodulesÚdeviceÚpromptsÚdefault_prompt_nameÚcache_folderÚtrust_remote_codeÚrevisionÚlocal_files_onlyÚtokenÚuse_auth_tokenÚmodel_kwargsr*   Úconfig_kwargsÚmodel_card_dataÚbackendÚsimilarity_fn_nameÚtruncate_dimc               óª  >• UU l         UU l        Ub+  [        R                  " S[        5        U
b  [        S5      eUn
[        TU ]  UUUUUUU	U
UUUUUUUS9  U   US;   a  U R                  SS9  g U(       a\  SU;   aU  SUR                  S5      S	   R                  5       ;   a.  [        S
 U  5       5      (       a  [        R                  S5        g g g g g )NzlThe `use_auth_token` argument is deprecated and will be removed in a future release of SentenceTransformers.zZBoth `token` and `use_auth_token` are specified. Please only specify the `token` argument.)Úmodel_name_or_pathr-   r.   r1   r2   r3   r4   r5   r7   r*   r8   r9   r:   r/   r0   )zhkunlp/instructor-basezhkunlp/instructor-largezhkunlp/instructor-xlF)Úinclude_promptÚ/Ú
instructorr   c              3  óh   #   • U  H(  n[        U[        5      (       d  M  UR                  v •  M*     g 7f©N©Ú
isinstancer   r?   )Ú.0Úmodules     Úm/home/mande/repo/quber/.venv/lib/python3.13/site-packages/sentence_transformers/sentence_transformer/model.pyÚ	<genexpr>Ú/SentenceTransformer.__init__.<locals>.<genexpr>Ò   s#   é € Ð[²t¨V¼zÈ&ÔRY×?ZÓ(�6×(Ö(²tùs   ‚2Ÿ2z¿Instructor models require `include_prompt=False` in the pooling configuration. Either update the model configuration or call `model.set_pooling_include_prompt(False)` after loading the model.)r;   r<   ÚwarningsÚwarnÚFutureWarningÚ
ValueErrorÚsuperÚ__init__Úset_pooling_include_promptÚsplitÚlowerÚanyÚloggerÚwarning)Úselfr>   r-   r.   r/   r0   r1   r2   r3   r4   r5   r6   r7   r*   r8   r9   r:   r;   r<   Ú	__class__s                      €rH   rP   ÚSentenceTransformer.__init__�   s  ø€ ð2 #5ˆÔØ(ˆÔð Ñ%Ü�MŠMØ~Üôð Ñ Ü Øpóð ð #ˆEä‰ÑØ1ØØØ%Ø/ØØ-ØØ%Ø-Ø'Ø+ØØØ 3ð 	ñ 	
ñ" 	ð Ð!nÓnØ×+Ñ+¸5Ð+ÒAæØÐ)Ó)ØÐ 2× 8Ñ 8¸Ó =¸aÑ @× FÑ FÓ HÓHäÑ[±tÓ[×[Ñ[Ü—‘ðGõð \ð Ið *ð ó    Úinputs)Ú	sentencesc                óv   • Uc  Uc  SU R                   ;   a  SnU R                  " SUUUUUUUUU	U
UUUUSS.UD6$ )at  
Computes embeddings specifically optimized for query representation.

This method is a specialized version of :meth:`encode` that differs in exactly two ways:

1. If no ``prompt_name`` or ``prompt`` is provided, it uses a predefined "query" prompt,
   if available in the model's ``prompts`` dictionary.
2. It sets the ``task`` to "query". If the model has a :class:`~sentence_transformers.base.modules.Router`
   module, it will use the "query" task type to route the input through the appropriate submodules.

.. tip::

    Adjusting ``batch_size`` can significantly improve processing speed. The optimal value depends on your
    hardware, model size, precision, and input length. Benchmark a few batch sizes on a small subset of your
    data to find the best value.

All other parameters are identical to :meth:`encode`. See :meth:`encode` for the full parameter documentation.
r'   ©r[   Úprompt_nameÚpromptÚ
batch_sizeÚshow_progress_barÚoutput_valueÚ	precisionÚconvert_to_numpyÚconvert_to_tensorr.   Únormalize_embeddingsr<   ÚpoolÚ
chunk_sizeÚtask© ©r/   Úencode©rW   r[   r_   r`   ra   rb   rc   rd   re   rf   r.   rg   r<   rh   ri   Úkwargss                   rH   Úencode_queryÚ SentenceTransformer.encode_queryØ   sl   € ðJ Ñ 6¡>°gÀÇÁÓ6MØ!ˆKà�{Š{ð 
ØØ#ØØ!Ø/Ø%ØØ-Ø/ØØ!5Ø%ØØ!Øñ
ð  ñ!
ð 	
rZ   c                óŒ   • Uc   Uc  S H  nUU R                   ;   d  M  Un  O   U R                  " SUUUUUUUUU	U
UUUUSS.UD6$ )a³  
Computes embeddings specifically optimized for document/passage representation.

This method is a specialized version of :meth:`encode` that differs in exactly two ways:

1. If no ``prompt_name`` or ``prompt`` is provided, it uses the first available prompt from the following
   candidates: ``"document"``, ``"passage"``, ``"corpus"`` (checked in that order).
2. It sets the ``task`` to "document". If the model has a :class:`~sentence_transformers.base.modules.Router`
   module, it will use the "document" task type to route the input through the appropriate submodules.

.. tip::

    Adjusting ``batch_size`` can significantly improve processing speed. The optimal value depends on your
    hardware, model size, precision, and input length. Benchmark a few batch sizes on a small subset of your
    data to find the best value.

All other parameters are identical to :meth:`encode`. See :meth:`encode` for the full parameter documentation.
)r(   ÚpassageÚcorpusr(   r^   rk   rl   )rW   r[   r_   r`   ra   rb   rc   rd   re   rf   r.   rg   r<   rh   ri   ro   Úcandidate_prompt_names                    rH   Úencode_documentÚ#SentenceTransformer.encode_document  s~   € ðJ Ñ 6¡>Û)JÐ%Ø(¨D¯L©LÕ8Ø"7�KÙñ *Kð
 �{Š{ð 
ØØ#ØØ!Ø/Ø%ØØ-Ø/ØØ!5Ø%ØØ!Øñ
ð  ñ!
ð 	
rZ   c                ó   • g rC   rk   rn   s                   rH   rm   ÚSentenceTransformer.encodeR  ó   € ð$ rZ   c                ó   • g rC   rk   rn   s                   rH   rm   ry   f  s   € ð$ rZ   c                ó   • g rC   rk   rn   s                   rH   rm   ry   z  rz   rZ   c                ó   • g rC   rk   rn   s                   rH   rm   ry   Ž  s   € ð$ rZ   c                ó   • g rC   rk   rn   s                   rH   rm   ry   ¢  s   € ð$ #&rZ   c                ó   • g rC   rk   rn   s                   rH   rm   ry   ¶  s   € ð$  rZ   c                ó   • g rC   rk   rn   s                   rH   rm   ry   Ê  rz   rZ   c                ó¢  • U R                   R                  S:X  ad  U R                  (       dS  SSKJn  [        US5      (       a<  [        UR                  S5      (       a!  UR                  R                  U SS9  SU l        Uc5  [        R                  5       [        R                  [        R                  4;   nU	(       a  SnUS:w  a  Sn	SnUS::  a  [        S	U S
35      eU R                  U5      nU(       a  U/nOO[        U[         5      (       d:  [        U["        R$                  5      (       a  UR'                  5       O
[!        U5      nU R)                  5       n[+        U5      [+        U5      -
  S1-
  =n(       as  [        U R,                  R.                   S[!        U5       S3U(       a#  SU R,                  R.                   SU S
3-   5      eSU R,                  R.                   S3-   5      eUb   U[0        ;  a  [        SU< S[0         35      eUc$  [        U
[         5      (       a>  [3        U
5      S:”  a/  U R4                  " U4UUU
UUUUUUUU	UUS.UD6nU(       a  US   nU$ U R7                  X25      nU
c  U R                   n
U R9                  U
5        U R;                  5         Ub  UOU R<                  n/ n["        R>                  " U Vs/ s H  nU RA                  U5      * PM     sn5      nU RC                  5       (       a  U RE                  U5      nU Vs/ s H  nUU   PM
     nnU R                   R                  S:H  n[G        S[3        U5      USU(       + S9 GHÌ  nUUUU-    nU RH                  " U4SU0UD6nU(       a  U RK                  U5      n[M        UU
5      nU RN                  " U40 UD6nU(       a  [P        RR                  " U5      nUb  [U        US   U5      US'   US:X  a…  / n[W        UU   US   5       Hl  u  nn [3        U 5      S-
  n!U!S:”  a;  U U!   RY                  5       S:X  a$  U!S-  n!U!S:”  a  U U!   RY                  5       S:X  a  M$  UR[                  USU!S-    5        Mn     O¦UcW  / n[]        [3        US   5      5       H9  n0 n"UR_                  5        H  u  n#n$ U$U   U"U#'   M     UR[                  U"5        M;     OLUU   nU(       a)  [        Rb                  Rd                  Rg                  USSS9nU(       a  URi                  5       nURk                  U5        GMÏ     ["        R>                  " U5       Vs/ s H  nUU   PM
     nnU(       a  U(       a  US:w  a
  [m        UUS9nU	(       a€  [3        U5      (       aO  [        U["        R$                  5      (       a  [        Rn                  " U5      nGOF[        Rp                  " U5      nGO.[        Rr                  " / U R                   S9nGOU(       aÁ  [        U["        R$                  5      (       d¡  U(       ae  US   Rt                  [        Rv                  :X  aD  ["        Rx                  " U V%s/ s H!  n%U%R{                  5       R}                  5       PM#     sn%5      nO{["        Rx                  " U V%s/ s H  n%U%R}                  5       PM     sn%5      nOE[        U["        R$                  5      (       a&  U V&s/ s H  n&[        Rn                  " U&5      PM     nn&U(       a  US   nU$ s  snf s  snf ! [`         a
    U$U"U#'    GM‘  f = fs  snf s  sn%f s  sn%f s  sn&f )ap  
Computes embeddings for the given inputs.

.. tip::

    If you are unsure whether you should use :meth:`encode`, :meth:`encode_query`, or :meth:`encode_document`,
    your best bet is to use :meth:`encode_query` and :meth:`encode_document` for Information Retrieval tasks
    with clear query and document/passage distinction, and use :meth:`encode` for all other tasks.

    Note that :meth:`encode` is the most general method and can be used for any task, including Information
    Retrieval, and that if the model was not trained with predefined prompts and/or task types, then all three
    methods will return identical embeddings.

.. tip::

    Adjusting ``batch_size`` can significantly improve processing speed. The optimal value depends on your
    hardware, model size, precision, and input length. Benchmark a few batch sizes on a small subset of your
    data to find the best value.

Args:
    inputs: The inputs to embed. Can be a string, a list of strings, or multimodal inputs
        (dicts, images, arrays).
    prompt_name (str, optional): The name of the prompt to use for encoding. Must be a key in the ``prompts``
        dictionary, which is either set in the constructor or loaded from the model configuration. For example if
        ``prompt_name`` is "query" and the ``prompts`` is {"query": "query: ", ...}, then the sentence "What
        is the capital of France?" will be encoded as "query: What is the capital of France?" because the sentence
        is appended to the prompt. If ``prompt`` is also set, this argument is ignored. Defaults to None.
    prompt (str, optional): The prompt to use for encoding. For example, if the prompt is "query: ", then the
        sentence "What is the capital of France?" will be encoded as "query: What is the capital of France?"
        because the sentence is appended to the prompt. If ``prompt`` is set, ``prompt_name`` is ignored.
        Defaults to None.
    batch_size (int, optional): The batch size used for the computation. Defaults to 32.
    show_progress_bar (bool, optional): Whether to output a progress bar when encoding. Defaults to None,
        in which case the progress bar will be shown if the logger's effective level is INFO or DEBUG.
    output_value (Optional[Literal["sentence_embedding", "token_embeddings"]], optional): The type of embeddings to return.
    precision (Literal["float32", "int8", "uint8", "binary", "ubinary"], optional): The precision to use for the embeddings.
    convert_to_numpy (bool, optional): Whether the output should be a list of numpy vectors.
    convert_to_tensor (bool, optional): Whether the output should be one large tensor.
    device (str, torch.device, list, or None, optional): Device(s) to use for computation. Can be:

        - A single device string (e.g., "cuda:0", "cpu") for single-process encoding
        - A list of device strings (e.g., ["cuda:0", "cuda:1"], ["cpu", "cpu", "cpu", "cpu"]) to distribute
          encoding across multiple processes
        - None to auto-detect available device for single-process encoding

        If a list is provided, multi-process encoding will be used. Defaults to None.
    normalize_embeddings (bool, optional): Whether to normalize returned vectors to have length 1.
    truncate_dim (int, optional): The dimension to truncate sentence embeddings to.
    pool (Dict[Literal["input", "output", "processes"], Any], optional): A pool created by
        ``start_multi_process_pool()``.
    chunk_size (int, optional): Size of chunks for multi-process encoding.
    **kwargs: Additional keyword arguments to pass to the model's ``preprocess`` and ``forward`` methods.

Returns:
    Union[List[Tensor], ndarray, Tensor, dict[str, Tensor], list[dict[str, Tensor]]]: By default, a 2d numpy
        array with shape [num_inputs, output_dimension] is returned. If ``output_value`` is ``None``, a list
        of dicts (or a single dict for singular input) is returned.
Úhpur   NÚwrap_in_hpu_graphT)Údisable_tensor_cacheFÚsentence_embeddingz+batch_size must be a positive integer, got Ú.rj   zZ.encode() has been called with additional keyword arguments that this model does not use: z. zAs per zA.get_model_kwargs(), the valid additional keyword arguments are: zQ.get_model_kwargs(), this model does not accept any additional keyword arguments.z
Precision z" is not supported, must be one of )rb   rh   r.   ri   r_   r`   ra   rc   rd   re   rf   rg   r<   ÚBatches©ÚdescÚdisabler`   Útoken_embeddingsÚattention_maskr   é   )ÚpÚdimr    )rd   )r.   )?r.   ÚtypeÚis_hpu_graph_enabledÚhabana_frameworks.torchr,   Úhasattrr‚   rƒ   rU   ÚgetEffectiveLevelr   ÚINFOÚDEBUGrN   Úis_singular_inputrE   ÚlistÚnpÚndarrayÚtolistÚget_model_kwargsÚsetrX   Ú__name__ÚALLOWED_PRECISIONSÚlenÚ_multi_processÚ_resolve_promptÚtoÚevalr<   ÚargsortÚ_input_lengthÚ_can_flatten_inputsÚ_interleave_sorted_indicesr   Ú
preprocessÚ_pad_features_for_hpur   ÚforwardÚcopyÚdeepcopyr   ÚzipÚitemÚappendÚrangeÚitemsÚ	TypeErrorr   Ú
functionalÚ	normalizeÚcpuÚextendr   Ú
from_numpyÚstackÚtensorÚdtypeÚbfloat16ÚasarrayÚfloatÚnumpy)'rW   r[   r_   r`   ra   rb   rc   rd   re   rf   r.   rg   r<   rh   ri   ro   Úhtr—   r7   Úunused_kwargsÚ
embeddingsÚall_embeddingsÚsenÚlength_sorted_idxÚidxÚinputs_sortedÚis_hpuÚstart_indexÚinputs_batchÚfeaturesÚout_featuresÚ	token_embÚ	attentionÚlast_mask_idÚ
batch_itemÚnameÚvalueÚembÚ	embeddings'                                          rH   rm   ry   Þ  s÷  € ð\ �;‰;×Ñ˜uÓ$¨T×-F×-FÝ0ä�r˜5×!Ñ!¤g¨b¯f©fÐ6I×&JÑ&JØ—‘×(Ñ(¨ÀDÐ(ÑIØ,0�Ô)àÑ$Ü &× 8Ñ 8Ó :¼w¿|¹|ÌWÏ]É]Ð>[Ñ [ÐæØ$ÐàÐ/Ó/Ø %ÐØ$Ðà˜‹?ÜÐJÈ:È,ÐVWÐXÓYÐYð !×2Ñ2°6Ó:ÐÞØ�X‰FÜ˜F¤D×)Ñ)ä(2°6¼2¿:¹:×(FÑ(F�V—]‘]”_ÌDÐQWËLˆFð ×,Ñ,Ó.ˆÜ ›K¬#¨lÓ*;Ñ;¸v¸hÑFÐFˆ=ÕFÜØ—>‘>×*Ñ*Ð+ð  ,Fô  GKð  LYó  GZð  F[ð  []ð  ^ö $ð ˜dŸn™n×5Ñ5Ð6Ð6wð  yEð  xFð  FGð  Hñóð ð
 # 4§>¡>×#:Ñ#:Ð";ð  <Mð  Nñ	óð ð Ñ  YÔ6HÓ%HÜ˜z¨)©Ð6XÔYkÐXlÐmÓnÐnð Ñ¤
¨6´4× 8Ñ 8¼SÀ»[È1»_Ø×,Ò,Øðð #4àØØ%à'ØØ%Ø)Ø#Ø!1Ø"3Ø%9Ø)ñ#ð$ ñ%ˆJö( !Ø'¨™]�
ØÐà×%Ñ% fÓ:ˆð ‰>Ø—[‘[ˆFØ�‰�ŒØ�	‰	Œà'3Ñ'?‘|ÀT×EVÑEVˆØˆÜŸJšJÉFÓ'SÊFÀS¨×);Ñ);¸CÓ)@Ó(@ÉFÑ'SÓTÐØ×#Ñ#×%Ñ%Ø $× ?Ñ ?Ð@QÓ RÐÙ0AÓBÒ0A¨˜ œÑ0AˆÐBà—‘×!Ñ! UÑ*ˆÜ! !¤S¨Ó%7¸È)ÐarÔ]rÕsˆKØ(¨°{ÀZÑ7OÐPˆLØ—’ |ÑM¸FÐMÀfÑMˆHæØ×5Ñ5°hÓ?�ä& x°Ó8ˆHàŸ<š<¨Ñ;°FÑ;ˆLÞÜ#Ÿ}š}¨\Ó:�àÑ'Ü5HØ Ð!5Ñ6¸ó6�Ð1Ñ2ð Ð1Ó1Ø�
Ü,/°¸\Ñ0JÈLÐYiÑLjÖ,kÑ(�I˜yÜ#& y£>°AÑ#5�LØ&¨Ó*¨y¸Ñ/F×/KÑ/KÓ/MÐQRÓ/RØ$¨Ñ)˜ð '¨Ó*¨y¸Ñ/F×/KÑ/KÓ/MÐQRÕ/Rà×%Ñ% iÐ0B°,ÀÑ2BÐ&CÖDò	 -lð
 Ñ%Ø�
Ü ¤ \Ð2FÑ%GÓ!HÖI�CØ!#�JØ'3×'9Ñ'9Ö';™˜˜eð5Ø/4°S©z˜J tÓ,ñ (<ð
 ×%Ñ% jÖ1ò Jð *¨,Ñ7�
Þ'Ü!&§¡×!4Ñ!4×!>Ñ!>¸zÈQÐTUÐ!>Ð!V�JÞ#Ø!+§¡Ó!1�Jà×!Ñ! *×-ñU tôX :<¿ºÐDUÔ9VÓWÒ9V°#˜.¨Ô-Ñ9VˆÐWæži¨I¸Ó,BÜ0°È9ÑUˆNæÜ�>×"Ñ"Ü˜n¬b¯j©j×9Ñ9Ü%*×%5Ò%5°nÓ%E’Nä%*§[¢[°Ó%@’Nä!&§¢¨b¸¿¹Ñ!E’ÞÜ˜n¬b¯j©j×9Ñ9Þ! n°QÑ&7×&=Ñ&=ÄÇÁÓ&OÜ%'§Z¢ZÑP^Ó0_ÒP^È°·±³×1BÑ1BÖ1DÑP^Ñ0_Ó%`‘Nä%'§Z¢ZÉÓ0WÊÀ°·±¶ÉÑ0WÓ%X�NøÜ˜¬¯
©
×3Ñ3ÙKYÓZÊ>¸iœe×.Ò.¨yÖ9É>ˆNÐZæØ+¨AÑ.ˆNàÐùòW (Tùò CøôF  )ó 5Ø/4˜J tÕ,ð5üò Xùò  1`ùâ0WùâZs6   Ë\Ì\!Ò/\&Õ\=Ù#(]Ú']Û, ]Ü&\:	Ü9\:	c                óL  • SU ;  a  U $ U S   R                   u  pUS:”  a-  S[        R                  " [        R                  " U5      5      -  OSnX2-
  nUS:X  a  U $ [        R
                  " U S   [        R                  " X4[        R                  S94S5      U S'   [        R
                  " U S   [        R                  " X4[        R                  S94S5      U S'   SU ;   aA  [        R
                  " U S   [        R                  " X4[        R                  S94S5      U S'   U $ )zFPad input features to the next power of 2 for HPU graph compatibility.Ú	input_idsr   r�   )r»   éÿÿÿÿrŒ   Útoken_type_ids)	ÚshapeÚmathÚceilÚlog2r,   ÚcatÚonesr   Úzeros)rË   ra   Úseq_lenÚ
padded_lenÚpad_lens        rH   rª   Ú)SentenceTransformer._pad_features_for_hpuÉ  s  € ð ˜hÓ&ØˆOà& {Ñ3×9Ñ9Ñˆ
Ø;BÀQ»;�Qœ$Ÿ)š)¤D§I¢I¨gÓ$6Ó7Ò7ÈAˆ
ØÑ&ˆØ�a‹<ØˆOä %§	¢	Ø�kÑ"¤E§J¢J°
Ð/DÌEÏJÉJÑ$WÐXÐZ\ó!
ˆ�Ñô &+§Y¢YØÐ&Ñ'¬¯ª°jÐ5JÔRW×R\ÑR\Ñ)]Ð^Ð`bó&
ˆÐ!Ñ"ð ˜xÓ'Ü).¯ªØÐ*Ñ+¬U¯[ª[¸*Ð9NÔV[×V`ÑV`Ñ-aÐbÐdfó*ˆHÐ%Ñ&ð ˆrZ   c                ó^   • U R                   c  [        R                  U l        U R                   $ )zyReturn the name of the similarity function.

If not previously set, accessing this property defaults it to ``"cosine"``.
)Ú_similarity_fn_namer   ÚCOSINEr;   ©rW   s    rH   r;   Ú&SentenceTransformer.similarity_fn_nameá  s*   € ð ×#Ñ#Ñ+Ü&8×&?Ñ&?ˆDÔ#Ø×'Ñ'Ð'rZ   c                óÄ   • [        U[        5      (       a  UR                  nUb6  [        R                  " U5      U l        [        R
                  " U5      U l        Xl        g rC   )rE   r   rÒ   Úto_similarity_fnÚ_similarityÚto_similarity_pairwise_fnÚ_similarity_pairwiserå   )rW   rÒ   s     rH   r;   rè   ë  sN   € ô �eÔ/×0Ñ0Ø—K‘KˆEØÑÜ1×BÒBÀ5ÓIˆDÔÜ(:×(TÒ(TÐUZÓ([ˆDÔ%Ø#(Õ rZ   c                ó   • g rC   rk   ©rW   Úembeddings1Úembeddings2s      rH   Ú
similarityÚSentenceTransformer.similarityö  s   € ØNQrZ   c                ó   • g rC   rk   rï   s      rH   rò   ró   ù  s   € ØpsrZ   c                ó2   • U R                     U R                  $ )zì
Return a function that computes the similarity between two collections of embeddings. The output will be a
matrix with the similarity scores between all embeddings from the first parameter and all embeddings from the
second parameter.
)r;   rë   rç   s    rH   rò   ró   ü  s   € ð 	×ÒØ×ÑÐrZ   c                ó   • g rC   rk   rï   s      rH   Úsimilarity_pairwiseÚ'SentenceTransformer.similarity_pairwise  s   € ØWZrZ   c                ó   • g rC   rk   rï   s      rH   r÷   rø   
  s   € ð rZ   c                ó2   • U R                     U R                  $ )z`
Return a function that computes the pairwise similarity between two collections of embeddings.
)r;   rí   rç   s    rH   r÷   rø     s   € ð 	×ÒØ×(Ñ(Ð(rZ   zÅThe `encode_multi_process` method has been deprecated, and its functionality has been integrated into `encode`. You can now call `encode` with the same parameters to achieve multi-process encoding.c                ó8   • U R                  UUUUUSUSSU	U
UUS9$ )zÛ
.. warning::
    This method is deprecated. You can now call :meth:`SentenceTransformer.encode`
    with the same parameters instead, which will automatically handle multi-process encoding using the provided ``pool``.
r…   TF)r_   r`   ra   rb   rc   rd   re   rf   rg   r<   rh   ri   )rm   )rW   r\   rh   r_   r`   ra   ri   rb   rd   rg   r<   s              rH   Úencode_multi_processÚ(SentenceTransformer.encode_multi_process  sA   € ð, �{‰{ØØ#ØØ!Ø/Ø-ØØ!Ø#Ø!5Ø%ØØ!ð ð 
ð 	
rZ   c           	     óê  • UR                  SS5      nUR                  SS5      nSUS'   Sn	Uc(  [        U[        5      (       a  U R                  U5      nSn	 UcG  [	        [
        R                  " [        U5      [        US   5      -  S-  5      S5      n[        US	5      nUS
   n
US   nSn[        [        S[        U5      U5      5       H  u  pÍXXÕ-    nU
R                  XÎU/5        M      [        [        US	-   SU(       + S9 Vs/ s H  oûR                  5       PM     snS S9nU Vs/ s H  nUS	   PM
     nnU(       a²  [        US   [        5      (       a)  [        [        R                  R!                  U5      5      nO¬[        US   ["        R$                  5      (       a  ["        R&                  " U5      nOs[        US   [(        R*                  5      (       a  [(        R,                  " USS9nO;U(       a  ["        R.                  " / 5      nOU(       a  [(        R0                  " / 5      nUU	(       a  U R3                  U5        $ $ s  snf s  snf ! U	(       a  U R3                  U5        f f = f)zÖInternal method for multi-process encoding.

Either ``pool`` or ``device`` (as a list) must be provided. If ``pool`` is ``None`` and ``device``
is a list, a temporary pool is created and cleaned up after encoding.
rf   Fre   rb   TÚ	processesé
   iˆ  r   ÚinputÚoutputr×   r   ÚChunksrˆ   c                ó   • U S   $ ©Nr   rk   )Úxs    rH   Ú<lambda>Ú4SentenceTransformer._multi_process.<locals>.<lambda>j  s   € ˜a šdrZ   )Úkey)Úaxis)ÚgetrE   r˜   Ústart_multi_process_poolÚminrÚ   rÛ   r    ÚmaxÚ	enumerater±   ÚputÚsortedr   Ú	itertoolsÚchainÚfrom_iterabler,   r   rÝ   r™   rš   Úconcatenaterº   ÚarrayÚstop_multi_process_pool)rW   r[   rb   rh   r.   ri   Úencode_kwargsrf   re   Úcreated_poolÚinput_queueÚoutput_queueÚchunk_idÚchunk_startÚchunkÚ_Úoutput_listr  rÂ   s                      rH   r¡   Ú"SentenceTransformer._multi_process@  s-  € ð *×-Ñ-Ð.AÀ5ÓIÐØ(×,Ñ,Ð-?ÀÓGÐØ-2ˆÐ)Ñ*ð ˆØ‰<œJ v¬t×4Ñ4Ø×0Ñ0°Ó8ˆDØˆLð&	3àÑ!Ü ¤§¢¬3¨v«;¼¸TÀ+Ñ=NÓ9OÑ+OÐRTÑ+TÓ!UÐW[Ó\�
Ü  ¨QÓ/�
à7;¸G±}ˆKØ8<¸X¹ˆLð ˆHÜ)2´5¸¼CÀ»KÈÓ3TÖ)UÑ%�Ø¨[Ñ-EÐF�Ø—‘ °-Ð @ÖAñ *Vô
 !Ü-3°H¸q±LÀxÐ]nÔYnÒ-oÓpÒ-o¨×!Ñ!Ö#Ñ-oÑpÙ"ñˆKñ 3>Ó>²+¨˜& œ)±+ˆJÐ>ÞÜ˜j¨™m¬T×2Ñ2Ü!%¤i§o¡o×&CÑ&CÀJÓ&OÓ!P‘JÜ 
¨1¡¬u¯|©|×<Ñ<Ü!&§¢¨:Ó!6‘JÜ 
¨1¡¬r¯z©z×:Ñ:Ü!#§¢°
ÀÑ!C�JøÞ"Ü"Ÿ\š\¨"Ó-‘
Þ!ÜŸXšX b›\�
Øö Ø×,Ñ,¨TÕ2ð ùò) qùò
 ?øö Ø×,Ñ,¨TÕ2ð ús,   ÁB1I Ä	IÄ"I Ä-IÄ<C7I É
I ÉI2c           	     óZ  •   UR                  5       u  pEnUR                  " U4SU 0UD6n[        U[        R                  5      (       a+  UR
                  R                  S:w  a  UR                  5       nOƒ[        U[        5      (       an  UR                  5        VV	s0 s HQ  u  p‰U[        U	[        R                  5      (       a*  U	R
                  R                  S:w  a  U	R                  5       OU	_MS     nnn	UR                  XG/5        GM  s  sn	nf ! [        R                   a     gf = f)z†Internal working process to encode inputs in multi-process setup.

Workers are terminated externally via ``stop_multi_process_pool``.
r.   r¶   N)r  rm   rE   r,   r   r.   r�   r¶   Údictr²   r  ÚqueueÚEmpty)
Útarget_deviceÚmodelr  Úresults_queuer  r[   ro   rÂ   r	  rÒ   s
             rH   Ú_multi_process_workerÚ)SentenceTransformer._multi_process_worker€  s  € ð ðØ+6¯?©?Ó+<Ñ(� &Ø"Ÿ\š\¨&ÑQ¸ÐQÈ&ÑQ�
ä˜j¬%¯,©,×7Ñ7¸J×<MÑ<M×<RÑ<RÐV[Ó<[Ø!+§¡Ó!1‘JÜ 
¬D×1Ñ1ð +5×*:Ñ*:Ô*<ô"â*<™J˜Cð ¬J°u¼e¿l¹l×,KÑ,KÐPU×P\ÑP\×PaÑPaÐejÓPj˜UŸY™Yœ[ÐpuÒuÙ*<ð ñ "ð ×!Ñ! 8Ð"8Ô9ò ùó"øô
 —;‘;ó Ùðús%   ƒBD ÂADÃ5D ÄD ÄD*Ä)D*c                óP   • U  H   n[        U[        5      (       d  M  Xl          g   g)zÍ
Sets the `include_prompt` attribute in the pooling layer in the model, if there is one.

This is useful for INSTRUCTOR models, as the prompt should be excluded from the pooling strategy
for these models.
NrD   )rW   r?   rG   s      rH   rQ   Ú.SentenceTransformer.set_pooling_include_prompt˜  s$   € ó ˆFÜ˜&¤'×*Ó*Ø(6Ô%Ùò rZ   zYThe `get_sentence_features` method is deprecated and will be removed in a future version.c                ó&   • U S   R                   " U6 $ r  )Úget_sentence_features)rW   rË   s     rH   r.  Ú)SentenceTransformer.get_sentence_features¤  s   € à�A‰w×,Ò,¨hÐ7Ð7rZ   c                ó&  • Sn[        U R                  R                  5       5       H6  nS H(  n[        X#S5      n[	        U5      (       d  M!  U" 5       n  O   Uc  M6    O   U R
                  b$  Uc  U R
                  $ [        XR
                  5      $ U$ )zÈ
Returns the number of dimensions in the output of :meth:`SentenceTransformer.encode`.

Returns:
    Optional[int]: The number of dimensions in the output of `encode`. If it's not known, it's `None`.
N)Úget_embedding_dimensionÚ get_sentence_embedding_dimensionÚget_word_embedding_dimension)ÚreversedÚ_modulesÚvaluesÚgetattrÚcallabler<   r  )rW   Ú
output_dimrG   rÑ   Úmethods        rH   r1  Ú+SentenceTransformer.get_embedding_dimension¨  s–   € ð ˆ
Ü˜tŸ}™}×3Ñ3Ó5Ö6ˆFó�ô
 ! ¨tÓ4�Ü˜F×#Ó#Ù!'£�JÙñð Ó%Ùñ 7ð ×ÑÑ(ØÑ!Ø×(Ñ(Ð(Ü�z×#4Ñ#4Ó5Ð5ØÐrZ   z\The `get_sentence_embedding_dimension` method has been renamed to `get_embedding_dimension`.)Úcategoryc                ó"   • U R                  5       $ rC   )r1  rç   s    rH   r2  Ú4SentenceTransformer.get_sentence_embedding_dimensionÂ  s   € ð
 ×+Ñ+Ó-Ð-rZ   c              #  ó\   #   • U R                   n Xl         Sv •  X l         g! X l         f = f7f)a¯  
In this context, :meth:`SentenceTransformer.encode` outputs
embeddings truncated at dimension ``truncate_dim``.

This may be useful when you are using the same model for different applications where different dimensions
are needed.

Args:
    truncate_dim (int, optional): The dimension to truncate embeddings to. ``None`` does no truncation.

Example:
    ::

        from sentence_transformers import SentenceTransformer

        model = SentenceTransformer("sentence-transformers/all-mpnet-base-v2")

        with model.truncate_embeddings(truncate_dim=16):
            embeddings_truncated = model.encode(["hello there", "hiya"])
        assert embeddings_truncated.shape[-1] == 16
N)r<   )rW   r<   Úoriginal_output_dims      rH   r   Ú'SentenceTransformer.truncate_embeddingsÉ  s.   é € ð. #×/Ñ/Ðð	4Ø ,ÔÛà 3ÕøÐ 3Õüs   ‚,�
! š,¡)©,zTThe `truncate_sentence_embeddings` method has been renamed to `truncate_embeddings`.c              #  ój   #   • U R                  U5         S v •  S S S 5        g ! , (       d  f       g = f7frC   )r   )rW   r<   s     rH   Útruncate_sentence_embeddingsÚ0SentenceTransformer.truncate_sentence_embeddingsç  s#   é € ð ×%Ñ% lÕ3Û÷ 4×3Ö3üs   ‚3”"™	3¢
0¬3zRSentenceTransformer.load(...) is deprecated, use SentenceTransformer(...) instead.c                ó   • [        U 5      $ )z8Deprecated: Use SentenceTransformer(input_path) instead.)r#   )Ú
input_paths    rH   ÚloadÚSentenceTransformer.loadð  s   € ô # :Ó.Ð.rZ   c
           	     ó  • UUUUS.n
Uc  0 U
EO0 U
EUEnUc  0 U
EO0 U
EUEnU	c  0 U
EO0 U
EU	En	[        UUUUU	U R                  S9nU/nUR                  S:X  a†  UR                  n[	        USS5      =(       a2    UR
                  S   R                  S5      =(       a    [	        USS	5      nU(       a  S
OSnUR                  [        UR                  5       U5      5        U(       d  U R                  R                  XS9  U0 4$ )a®  
Creates a simple Transformer + Mean Pooling model and returns the modules, except for
CausalLM-based models which use Last Token pooling instead.

This is used as a fallback when no pre-trained SentenceTransformer model is found.

Args:
    model_name_or_path (str): The name or path of the pre-trained model.
    token (Optional[Union[bool, str]]): The token to use for the model.
    cache_folder (Optional[str]): The folder to cache the model.
    revision (Optional[str], optional): The revision of the model. Defaults to None.
    trust_remote_code (bool, optional): Whether to trust remote code. Defaults to False.
    local_files_only (bool, optional): Whether to use only local files. Defaults to False.
    model_kwargs (Optional[Dict[str, Any]], optional): Additional keyword arguments for the model. Defaults to None.
    processor_kwargs (Optional[Dict[str, Any]], optional): Additional keyword arguments for the processor/tokenizer. Defaults to None.
    config_kwargs (Optional[Dict[str, Any]], optional): Additional keyword arguments for the config. Defaults to None.

Returns:
    tuple[list[nn.Module] | OrderedDict[str, nn.Module], dict[str, Any]]: A tuple of (modules, config).
)r5   r2   r3   r4   N)Ú	cache_dirr7   r*   r8   r:   r‹   Úarchitecturesr   ÚForCausalLMÚ	is_causalTÚ	lasttokenÚmean)r3   )r   r:   Úmodule_output_nameÚconfigr7  rK  Úendswithr°   r   r1  r9   Úset_base_model)rW   r>   r5   r1   r3   r2   r4   r7   r*   r8   Úshared_kwargsÚtransformer_modelr-   rQ  Úis_causal_lmÚpooling_modes                   rH   Ú_load_default_modulesÚ)SentenceTransformer._load_default_modulesö  sK  € ðB Ø!2Ø Ø 0ñ	
ˆð -9Ñ,@Ð(˜-Ñ(ÐFgÈÐFgÐZfÐFgˆØ0@Ñ0HÐ,˜mÑ,ÐNsÐQ^ÐNsÐbrÐNsÐØ-:Ñ-BÐ)˜=Ñ)ÐHjÈ=ÐHjÐ\iÐHjˆä'ØØ"Ø%Ø-Ø'Ø—L‘Lñ
Ðð %Ð%ˆØ×/Ñ/Ð3EÓEØ&×-Ñ-ˆFô ˜ °Ó6÷ 7Ø×(Ñ(¨Ñ+×4Ñ4°]ÓC÷7ä˜F K°Ó6ð ö
 +7™;¸FˆLØ�N‰Nœ7Ð#4×#LÑ#LÓ#NÐP\Ó]Ô^ÞØ× Ñ ×/Ñ/Ð0BÐ/ÑVØ˜ˆ{ÐrZ   c                ó¶   >• [         TU ]  U5        U R                  c  UR                  SS 5      U l        U R
                  c  UR                  SS 5      U l        g g ©Nr;   r<   )rO   Ú_parse_model_configrå   r  r;   r<   )rW   Úmodel_configrX   s     €rH   r\  Ú'SentenceTransformer._parse_model_config8  sX   ø€ Ü‰Ñ# LÔ1Ø×#Ñ#Ñ+Ø&2×&6Ñ&6Ð7KÈTÓ&RˆDÔ#Ø×ÑÑ$Ø ,× 0Ñ 0°ÀÓ FˆDÕð %rZ   c                óz   >• [         TU ]  5       SU R                  0-  nU R                  b  U R                  US'   U$ r[  )rO   Ú_get_model_configr;   r<   )rW   rQ  rX   s     €rH   r`  Ú%SentenceTransformer._get_model_config?  sH   ø€ Ü‘Ñ*Ó,Ø  $×"9Ñ"9ð0
ñ 
ˆð ×ÑÑ(Ø%)×%6Ñ%6ˆF�>Ñ"ØˆrZ   c                ó4   • U R                  UUUUUUUUU	5	      $ rC   )rX  )rW   r>   r5   r1   r3   r2   r4   r7   r*   r8   Ú
model_types              rH   Ú_load_converted_modulesÚ+SentenceTransformer._load_converted_modulesG  s2   € ð ×)Ñ)ØØØØØØØØØó

ð 
	
rZ   c           	     ól   • U R                   R                  nU R                  5       nSU SU SU SU S3	$ )Nz·## Testing this pull request
You can test this pull request before merging by loading the model from this PR with the `revision` argument:
```python
from sentence_transformers import zO

# NOTE: Update this to the number of your pull request
pr_number = 2
model = z(
    "z5",
    revision=f"refs/pr/{pr_number}",
    backend="aÒ  ",
)

# Verify that everything works as expected
embeddings = model.encode(["The weather is lovely today.", "It's so sunny outside!", "He drove to the stadium."])
print(embeddings.shape)

similarities = model.similarity(embeddings, embeddings)
print(similarities)
```

---
*This PR was auto-generated with [`push_to_hub`](https://sbert.net/docs/package_reference/sentence_transformer/SentenceTransformer.html#sentence_transformers.SentenceTransformer.push_to_hub).*
)rX   rž   Úget_backend)rW   Úrepo_idÚ
class_namer:   s       rH   Ú_push_to_hub_usage_tipÚ*SentenceTransformer._push_to_hub_usage_tipa  sZ   € Ø—^‘^×,Ñ,ˆ
Ø×"Ñ"Ó$ˆð#ð $. ,ð /	ð 
ˆð Ø€Yð àˆYð ðð 	rZ   )rë   rå   rí   r‘   r;   r<   rC   )&r>   r%   r-   zlist[nn.Module] | Noner.   r%   r/   zdict[str, str] | Noner0   r%   r1   r%   r2   Úboolr3   r%   r4   rl  r5   úbool | str | Noner6   rm  r7   údict[str, Any] | Noner*   rn  r8   rn  r9   z'SentenceTransformerModelCardData | Noner:   z$Literal['torch', 'onnx', 'openvino']r;   úNLiteral['cosine', 'dot', 'euclidean', 'manhattan'] | SimilarityFunction | Noner<   ú
int | NoneÚreturnÚNone)NNé    Nr…   r    TFNFNNN)r[   úlist[SingleInput] | SingleInputr_   r%   r`   r%   ra   Úintrb   úbool | Nonerc   z8Literal['sentence_embedding', 'token_embeddings'] | Nonerd   ú8Literal['float32', 'int8', 'uint8', 'binary', 'ubinary']re   rl  rf   rl  r.   ú%str | list[str | torch.device] | Nonerg   rl  r<   rp  rh   ú9dict[Literal['input', 'output', 'processes'], Any] | Noneri   rp  rq  zPlist[Tensor] | np.ndarray | Tensor | dict[str, Tensor] | list[dict[str, Tensor]]).............)r[   r   r_   r%   r`   r%   ra   ru  rb   rv  rc   ú1Literal['sentence_embedding', 'token_embeddings']rd   rw  re   úLiteral[False]rf   rl  r.   rx  rg   rl  r<   rp  rh   ry  ri   rp  rq  r   )r[   rt  r_   r%   r`   r%   ra   ru  rb   rv  rc   úLiteral['sentence_embedding']rd   rw  re   úLiteral[True]rf   r{  r.   rx  rg   rl  r<   rp  rh   ry  ri   rp  rq  ú
np.ndarray)r[   rt  r_   r%   r`   r%   ra   ru  rb   rv  rc   r|  rd   rw  re   rl  rf   r}  r.   rx  rg   rl  r<   rp  rh   ry  ri   rp  rq  r   )r[   úlist[SingleInput]r_   r%   r`   r%   ra   ru  rb   rv  rc   rz  rd   rw  re   rl  rf   rl  r.   rx  rg   rl  r<   rp  rh   ry  ri   rp  rq  zlist[Tensor])r[   r  r_   r%   r`   r%   ra   ru  rb   rv  rc   rr  rd   rw  re   rl  rf   rl  r.   rx  rg   rl  r<   rp  rh   ry  ri   rp  rq  zlist[dict[str, Tensor]])r[   r   r_   r%   r`   r%   ra   ru  rb   rv  rc   rr  rd   rw  re   rl  rf   rl  r.   rx  rg   rl  r<   rp  rh   ry  ri   rp  rq  údict[str, Tensor])r[   r   r_   r%   r`   r%   ra   ru  rb   rv  rc   zLiteral['token_embeddings']rd   rw  re   rl  rf   rl  r.   rx  rg   rl  r<   rp  rh   ry  ri   rp  rq  r   )rË   r€  rq  r€  )rq  z2Literal['cosine', 'dot', 'euclidean', 'manhattan'])rÒ   ro  rq  rr  )rð   r   rñ   r   rq  r   )rð   únpt.NDArray[np.float32]rñ   r�  rq  r   )rq  zVCallable[[Tensor | npt.NDArray[np.float32], Tensor | npt.NDArray[np.float32]], Tensor])NNrs  NNr    FN)r\   z	list[str]rh   z2dict[Literal['input', 'output', 'processes'], Any]r_   r%   r`   r%   ra   ru  ri   rp  rb   rv  rd   rw  rg   rl  r<   rp  rq  r~  )TNNN)r[   r  rb   rv  rh   ry  r.   rx  ri   rp  rq  zlist | Tensor | np.ndarray)
r&  Ústrr'  r#   r  r   r(  r   rq  rr  )r?   rl  rq  rr  )rq  r€  )rq  rp  )r<   rp  rq  zIterator[None])rF  r‚  rq  r#   )NFFNNN)r>   r‚  r5   rm  r1   r%   r3   r%   r2   rl  r4   rl  r7   rn  r*   rn  r8   rn  rq  úDtuple[list[nn.Module] | OrderedDict[str, nn.Module], dict[str, Any]])r]  údict[str, Any]rq  rr  )rq  r„  )NFFNNNN)r>   r‚  r5   rm  r1   r%   r3   r%   r2   rl  r4   rl  r7   rn  r*   rn  r8   rn  rc  r%   rq  rƒ  )rh  r‚  rq  r‚  )-rž   Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   Úmodel_card_data_classr&   Ú__annotations__r)   r   rP   rp   rv   r   rm   r,   Úinference_modeÚstaticmethodrª   Úpropertyr;   Úsetterrò   r÷   r   rü   r¡   r)  rQ   r.  r1  rM   r2  r   r   rC  rG  rX  r\  r`  rd  rj  Ú__static_attributes__Ú__classcell__)rX   s   @rH   r#   r#   )   s­  ø‡ ñ_ðB =ÐØ3JÐ$ jÓJØ8<È$Ñ.OÐÐ+ÓOáÐ(:Ñ;ð *.ðFð +/Ø!Ø)-Ø*.Ø#'Ø"'Ø#Ø!&Ø#'Ø,0Ø.2Ø26Ø/3ØCGØ8?àmqØ#'ñ+Fà&ðFð (ð	Fð
 ðFð 'ðFð (ðFð !ðFð  ðFð ðFð ðFð !ðFð *ðFð ,ðFð 0ðFð  -ð!Fð" Að#Fð$ 6ð%Fð( kð)Fð* !ð+Fð, 
÷-Fð Fó <ðFñP  Ñ*ð #'Ø!ØØ)-ØQeØNWØ!%Ø"'Ø8<Ø%*Ø#'ØJNØ!%ð8
à/ð8
ð  ð8
ð ð	8
ð
 ð8
ð 'ð8
ð Oð8
ð Lð8
ð ð8
ð  ð8
ð 6ð8
ð #ð8
ð !ð8
ð Hð8
ð ð8
ð" 
Zô#8
ó +ð8
ñt  Ñ*ð #'Ø!ØØ)-ØQeØNWØ!%Ø"'Ø8<Ø%*Ø#'ØJNØ!%ð;
à/ð;
ð  ð;
ð ð	;
ð
 ð;
ð 'ð;
ð Oð;
ð Lð;
ð ð;
ð  ð;
ð 6ð;
ð #ð;
ð !ð;
ð Hð;
ð ð;
ð" 
Zô#;
ó +ð;
ð| ð #&Ø ØØ),ØJMØNQØ+.Ø"%Ø8;Ø%(Ø#&ØJMØ!$ðàðð  ðð ð	ð
 ðð 'ðð Hðð Lðð )ðð  ðð 6ðð #ðð !ðð Hðð ðð" 
ô#ó ðð& ð #&Ø ØØ),Ø69ØNQØ*-Ø,/Ø8;Ø%(Ø#&ØJMØ!$ðà/ðð  ðð ð	ð
 ðð 'ðð 4ðð Lðð (ðð *ðð 6ðð #ðð !ðð Hðð ðð" 
ô#ó ðð& ð #&Ø ØØ),Ø69ØNQØ!$Ø+.Ø8;Ø%(Ø#&ØJMØ!$ðà/ðð  ðð ð	ð
 ðð 'ðð 4ðð Lðð ðð )ðð 6ðð #ðð !ðð Hðð ðð" 
ô#ó ðð& ð #&Ø ØØ),ØJMØNQØ!$Ø"%Ø8;Ø%(Ø#&ØJMØ!$ðà!ðð  ðð ð	ð
 ðð 'ðð Hðð Lðð ðð  ðð 6ðð #ðð !ðð Hðð ðð" 
ô#ó ðð& ð #&Ø ØØ),Ø ØNQØ!$Ø"%Ø8;Ø%(Ø#&ØJMØ!$ð&à!ð&ð  ð&ð ð	&ð
 ð&ð 'ð&ð ð&ð Lð&ð ð&ð  ð&ð 6ð&ð #ð&ð !ð&ð Hð&ð ð&ð" 
!ô#&ó ð&ð& ð #&Ø ØØ),Ø ØNQØ!$Ø"%Ø8;Ø%(Ø#&ØJMØ!$ð àð ð  ð ð ð	 ð
 ð ð 'ð ð ð ð Lð ð ð ð  ð ð 6ð ð #ð ð !ð ð Hð ð ð ð" 
ô# ó ð ð& ð #&Ø ØØ),Ø47ØNQØ!$Ø"%Ø8;Ø%(Ø#&ØJMØ!$ðàðð  ðð ð	ð
 ðð 'ðð 2ðð Lðð ðð  ðð 6ðð #ðð !ðð Hðð ðð" 
ô#ó ðð& ×ÒÓÙ Ñ*ð #'Ø!ØØ)-ØQeØNWØ!%Ø"'Ø8<Ø%*Ø#'ØJNØ!%ðgà/ðgð  ðgð ð	gð
 ðgð 'ðgð Oðgð Lðgð ðgð  ðgð 6ðgð #ðgð !ðgð Hðgð ðgð" 
Zô#gó +ó ðgðR óó ðð. ó(ó ð(ð ×Ñð)Øcð)à	ó)ó ð)ð ÛQó ØQàÛsó Øsàó ó ð ð ÛZó ØZàðØ2ðØAXðà	óó ðð ð)à	_ó)ó ð)ñ ð	`óð #'Ø!ØØ!%Ø)-ØNWØ%*Ø#'ð 
àð 
ð Að 
ð  ð	 
ð
 ð 
ð ð 
ð ð 
ð 'ð 
ð Lð 
ð #ð 
ð !ð 
ð 
ô 
ó	ð 
ðJ *.ØJNØ8<Ø!%ð>3à!ð>3ð 'ð>3ð Hð	>3ð
 6ð>3ð ð>3ð 
$õ>3ð@ ðØðØ#6ðØEJðØ[`ðà	óó ðô.
ñ ÐkÓló8ó mð8ôñ4 ØfØñó.ó	ð.ð ó4ó ð4ð: ÙØ^Øñóó	ó ð
ð ÙÐdÓeó/ó fó ð/ð  $Ø"'Ø!&Ø.2Ø26Ø/3ð@àð@ð !ð@ð !ð	@ð
 ð@ð  ð@ð ð@ð ,ð@ð 0ð@ð -ð@ð 
Nõ@÷DG÷ð  $Ø"'Ø!&Ø.2Ø26Ø/3Ø!%ð
àð
ð !ð
ð !ð	
ð
 ð
ð  ð
ð ð
ð ,ð
ð 0ð
ð -ð
ð ð
ð 
Nõ
÷4ò rZ   r#   )<Ú
__future__r   r¬   r  r   rÚ   r$  rK   Úcollectionsr   Úcollections.abcr   r   Ú
contextlibr   Úmultiprocessingr   Útypingr	   r
   r   r¿   r™   Únumpy.typingÚnptr,   r   r   Útqdm.autonotebookr   Útransformers.utilsÚtransformers_loggingÚtyping_extensionsr   Ú)sentence_transformers.base.modality_typesr   Ú sentence_transformers.base.modelr   Ú"sentence_transformers.base.modulesr   Ú2sentence_transformers.sentence_transformer.modulesr   Úsentence_transformers.utilr   r   Ú%sentence_transformers.util.decoratorsr   Ú'sentence_transformers.util.quantizationr   Ú%sentence_transformers.util.similarityr   Ú	fit_mixinr   Ú
model_cardr   Ú
get_loggerrž   rU   rŸ   r#   rk   rZ   rH   Ú<module>r¨     s‡   ðÝ "ã Û Û Û Û Û Ý #ß .Ý %Ý !ß )Ñ )ã Ý Û ß Ý $Ý >Ý (å AÝ 6Ý :Ý Fß KÝ CÝ GÝ Då Ý 8ð 
×	(Ò	(¨Ó	2€âFÐ ôT˜) Xõ TrZ   