§
    æ˜ºh·  ã                   óL   — d dl mZmZ d dlmZmZ  G d„ dej        ¦  «        ZdS )é    )ÚnnÚTensor)ÚIterableÚDictc                   óN   ‡ — e Zd ZdZˆ fd„Zdeeeef                  defd„Z	ˆ xZ
S )ÚMSELossa£  
    Computes the MSE loss between the computed sentence embedding and a target sentence embedding. This loss
    is used when extending sentence embeddings to new languages as described in our publication
    Making Monolingual Sentence Embeddings Multilingual using Knowledge Distillation: https://arxiv.org/abs/2004.09813

    For an example, see the documentation on extending language models to new languages.
    c                 ó”   •— t          t          | ¦  «                             ¦   «          || _        t	          j        ¦   «         | _        dS )z8
        :param model: SentenceTransformerModel
        N)Úsuperr   Ú__init__Úmodelr   Úloss_fct)Úselfr   Ú	__class__s     €úl/var/www/html/services/rag-service/venv/lib/python3.11/site-packages/sentence_transformers/losses/MSELoss.pyr   zMSELoss.__init__   s9   ø€ õ 	�g�tÑÔ×%Ò%Ñ'Ô'Ð'ØˆŒ
Ýœ
™œˆŒˆˆó    Úsentence_featuresÚlabelsc                 óp   — |                       |d         ¦  «        d         }|                      ||¦  «        S )Nr   Úsentence_embedding)r   r   )r   r   r   Úreps       r   ÚforwardzMSELoss.forward   s3   € Ø�jŠjÐ*¨1Ô-Ñ.Ô.Ð/CÔDˆØ�}Š}˜S &Ñ)Ô)Ð)r   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   Ústrr   r   Ú__classcell__)r   s   @r   r   r      sr   ø€ € € € € ðð ð%ð %ð %ð %ð %ð*¨°$°s¸F°{Ô2CÔ)Dð *Èfð *ð *ð *ð *ð *ð *ð *ð *r   r   N)Útorchr   r   Útypingr   r   ÚModuler   © r   r   ú<module>r"      sk   ðØ Ð Ð Ð Ð Ð Ð Ð Ø !Ð !Ð !Ð !Ð !Ð !Ð !Ð !ð*ð *ð *ð *ð *ˆbŒiñ *ô *ð *ð *ð *r   