
    sOi                     (   U d dl mZmZmZ d dlmZ d dlmZ d dlm	Z	 d dl
mZmZ d dlmZ d dlmZmZ  edd	d
dd eddd      d       eddddd ed      d       eddddd ed      d       eddddd  ed      d!       ed"dd#dd$ ed"      d       ed%dd&dd$ ed%      d       ed'dd(dd$ ed'      d       ed)dd*d+d, ed)      d       ed-d.d/d+d0 ed1      d      g	Zee   ed2<    G d3 d4e      Z G d5 d6e      Zy7)8    )AnyIterableType)
NumpyArray)OnnxOutputContext)	normalize)OnnxTextEmbeddingOnnxTextEmbeddingWorker)PooledEmbedding)DenseModelDescriptionModelSourcez&sentence-transformers/all-MiniLM-L6-v2i  zText embeddings, Unimodal (text), English, 256 input tokens truncation, Prefixes for queries/documents: not necessary, 2021 year.z
apache-2.0g
ףp=
?z]https://storage.googleapis.com/qdrant-fastembed/sentence-transformers-all-MiniLM-L6-v2.tar.gzzqdrant/all-MiniLM-L6-v2-onnxT)urlhf_deprecated_tar_structz
model.onnx)modeldimdescriptionlicense
size_in_GBsources
model_filez!jinaai/jina-embeddings-v2-base-eni   zText embeddings, Unimodal (text), English, 8192 input tokens truncation, Prefixes for queries/documents: not necessary, 2023 year.gp=
ף?z!xenova/jina-embeddings-v2-base-en)r   zonnx/model.onnxz"jinaai/jina-embeddings-v2-small-eni   gQ?z"xenova/jina-embeddings-v2-small-enz!jinaai/jina-embeddings-v2-base-dezText embeddings, Unimodal (text), Multilingual (German, English), 8192 input tokens truncation, Prefixes for queries/documents: not necessary, 2024 year.g{Gz?zonnx/model_fp16.onnxz#jinaai/jina-embeddings-v2-base-codezText embeddings, Unimodal (text), Multilingual (English, 30 programming languages), 8192 input tokens truncation, Prefixes for queries/documents: not necessary, 2024 year.g{Gz?z!jinaai/jina-embeddings-v2-base-zhzText embeddings, Unimodal (text), supports mixed Chinese-English input text, 8192 input tokens truncation, Prefixes for queries/documents: not necessary, 2024 year.z!jinaai/jina-embeddings-v2-base-eszText embeddings, Unimodal (text), supports mixed Spanish-English input text, 8192 input tokens truncation, Prefixes for queries/documents: not necessary, 2024 year.zthenlper/gte-basezGeneral text embeddings, Unimodal (text), supports English only input text, 512 input tokens truncation, Prefixes for queries/documents: not necessary, 2024 year.mitg)\(?zthenlper/gte-largei   zText embeddings, Unimodal (text), English, 512 input tokens truncation, Prefixes for queries/documents: not necessary, 2023 year.g333333?zqdrant/gte-large-onnx"supported_pooled_normalized_modelsc                   ^    e Zd Zedee   fd       Zedee   fd       Z	de
dedee   fdZy)PooledNormalizedEmbeddingreturnc                     t         S )N)PooledNormalizedEmbeddingWorkerclss    q/volume1/homes/robertsu/coba/app/.venv/lib/python3.12/site-packages/fastembed/text/pooled_normalized_embedding.py_get_worker_classz+PooledNormalizedEmbedding._get_worker_class   s    ..    c                     t         S )zLists the supported models.

        Returns:
            list[DenseModelDescription]: A list of DenseModelDescription objects containing the model information.
        )r   r   s    r!   _list_supported_modelsz0PooledNormalizedEmbedding._list_supported_models   s
     21r#   outputkwargsc                     |j                   t        d      |j                  }|j                   }t        | j	                  ||            S )Nz<attention_mask must be provided for document post-processing)attention_mask
ValueErrormodel_outputr   mean_pooling)selfr&   r'   
embeddings	attn_masks        r!   _post_process_onnx_outputz3PooledNormalizedEmbedding._post_process_onnx_output   sJ       ([\\((
))	**:yABBr#   N)__name__
__module____qualname__classmethodr   r
   r"   listr   r%   r   r   r   r   r0    r#   r!   r   r      sh    /$'>"? / / 2t,A'B 2 2C'C36C	*	Cr#   r   c                   $    e Zd ZdedededefdZy)r   
model_name	cache_dirr'   r   c                      t        d||dd|S )N   )r8   r9   threadsr6   )r   )r-   r8   r9   r'   s       r!   init_embeddingz.PooledNormalizedEmbeddingWorker.init_embedding   s)     ) 
!
 	
 	
r#   N)r1   r2   r3   strr   r	   r=   r6   r#   r!   r   r      s-    

 
 	

 

r#   r   N)typingr   r   r   fastembed.common.typesr   fastembed.common.onnx_modelr   fastembed.common.utilsr   fastembed.text.onnx_embeddingr	   r
   fastembed.text.pooled_embeddingr   "fastembed.common.model_descriptionr   r   r   r5   __annotations__r   r   r6   r#   r!   <module>rG      s   & & . 9 , T ; Q 6H o-#'

    1H BC$ 2H CD$ 1H BC) 3f DE$ 1f BC$ 1f BC$ !e 23$ "H 67KqC "D)>$? qhC C2
&= 
r#   