a
    h                     @  s6   d Z ddlmZ ddlZddlmZ G dd dZdS )a@  
This file contains deprecated code that can only be used with the old `model.fit`-style Sentence Transformers v2.X training.
It exists for backwards compatibility with the `model.old_fit` method, but will be removed in a future version.

Nowadays, with Sentence Transformers v3+, it is recommended to use the `SentenceTransformerTrainer` class to train models.
See https://www.sbert.net/docs/sentence_transformer/training_overview.html for more information.

Instead, you should create a `datasets` `Dataset` for training: https://huggingface.co/docs/datasets/create_dataset
    )annotationsN   )InputExamplec                   @  s"   e Zd ZdZdd ZdddZdS )	PairedFilesReaderz/Reads in the a Pair Dataset, split in two filesc                 C  s
   || _ d S )N)	filepaths)selfr    r   k/var/www/html/assistant/venv/lib/python3.9/site-packages/sentence_transformers/readers/PairedFilesReader.py__init__   s    zPairedFilesReader.__init__r   c           	      C  s   g }| j D ]4}|dr(tj|dddn
t|dd}|| q
g }d}|sg }|D ]&}| }|dkrpd} q||| qT|rq|ttt||dd	 |d
krHt||krHqqH|S )Nz.gzrtzutf-8)encodingF Tr   )Zguidtextslabelr   )	r   endswithgzipopenappendreadliner   strlen)	r   Zmax_examplesZfInsfilepathZfInZexampleseofr   textr   r   r	   get_examples   s.    

zPairedFilesReader.get_examplesN)r   )__name__
__module____qualname____doc__r
   r   r   r   r   r	   r      s   r   )r   
__future__r   r   r   r   r   r   r   r   r	   <module>   s   
