
    bi                    D    d Z ddlmZ ddlZddlmZ  G 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                       e Zd ZdZd ZddZdS )PairedFilesReaderz/Reads in the a Pair Dataset, split in two filesc                    || _         d S )N)	filepaths)selfr	   s     j/root/projects/butler/venv/lib/python3.11/site-packages/sentence_transformers/readers/PairedFilesReader.py__init__zPairedFilesReader.__init__   s    "    r   c           	        g }| j         D ]T}|                    d          rt          j        |dd          nt          |d          }|                    |           Ug }d}|sg }|D ]5}|                                }|dk    rd} n|                    |           6|rn[|                    t          t          t          |                    |d	                     |d
k    rt          |          |k    rn||S )Nz.gzrtzutf-8)encodingF Tr   )guidtextslabelr   )	r	   endswithgzipopenappendreadliner   strlen)	r
   max_examplesfInsfilepathfInexampleseofr   texts	            r   get_exampleszPairedFilesReader.get_examples   s7    	 	H $$U++6	(D7;;;;(W555 
 KK 	E # #||~~2::CET"""" OOLc#h--.@.@UVWWWXXXaCMM\$A$A!  	$ r   N)r   )__name__
__module____qualname____doc__r   r#    r   r   r   r      s=        99# # #     r   r   )r'   
__future__r   r   r   r   r   r(   r   r   <module>r*      sp     # " " " " "       % % % % % % % % % %r   