o
    S"g                     @  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   q/mnt/skqttb/ctump_chatbot/chatbot/lib/python3.10/site-packages/sentence_transformers/readers/PairedFilesReader.py__init__   s   
zPairedFilesReader.__init__r   c           	      C  s   g }| j D ]}|drtj|dddnt|dd}|| qg }d}|s`g }|D ]}| }|dkr8d} n|| q*|rC	 |S |ttt||dd	 |d
kr^t||kr^	 |S |r&|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   textr   r   r	   get_examples   s4   

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
    
