§
    +�’j,  ã                  óz  — d dl mZ ddlmZ ddlmZ ddlmZmZm	Z	m
Z
mZ ddlmZmZmZmZmZmZmZ ddlmZmZmZmZmZ ddlmZ dd	lmZmZ dd
lm Z m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z( ddl)m*Z* ddl+m,Z,m-Z-m.Z.m/Z/m0Z0 ddl1m2Z2m3Z3m4Z4m5Z5m6Z6m7Z7m8Z8m9Z9m:Z:m;Z;m<Z<m=Z=m>Z>m?Z?m@Z@ ddlAmBZBmCZCmDZDmEZEmFZFmGZGmHZHmIZImJZJmKZKmLZLmMZM g d¢ZNdS )é    )Úannotationsé   )Úresolve_ids)Úsave_to_hub_args_decorator)Ú
all_gatherÚall_gather_paddedÚall_gather_with_gradÚget_rankÚget_world_size)Úcheck_package_availabilityÚcheck_version_requirementsÚget_device_nameÚis_accelerate_availableÚis_datasets_availableÚis_dist_initializedÚis_training_available)Údisabled_tqdmÚhttp_getÚis_sentence_transformer_modelÚload_dir_pathÚload_file_path)Úmine_hard_negatives)ÚLoggingHandlerÚinstall_logger)	ÚORIGINAL_TRANSFORMER_MODELSÚappend_to_last_rowÚcheck_teacher_targetsÚdisable_datasets_cachingÚdisable_loggingÚfullnameÚimport_from_stringÚimport_module_classÚsimilarity_fct_name)Úquantize_embeddings)Úcommunity_detectionÚinformation_retrievalÚparaphrase_miningÚparaphrase_mining_embeddingsÚsemantic_search)ÚSimilarityFunctionÚcos_simÚ	dot_scoreÚeuclidean_simÚmanhattan_simÚmaxsimÚmaxsim_pairwiseÚmean_maxsimÚmean_maxsim_pairwiseÚpairwise_angle_simÚpairwise_cos_simÚpairwise_dot_scoreÚpairwise_euclidean_simÚpairwise_manhattan_simÚpytorch_cos_sim)Ú_convert_to_batchÚ_convert_to_batch_tensorÚ_convert_to_tensorÚbatch_to_deviceÚcat_padded_token_embeddingsÚcompute_count_vectorÚnormalize_embeddingsÚrepad_flattened_featuresÚselect_max_active_dimsÚstack_padded_token_embeddingsÚto_scipy_cooÚtruncate_embeddings)@r   r   r   r	   r
   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r    r#   r   r!   r"   r   r   r   r   r%   r&   r'   r(   r)   r$   r*   r+   r,   r-   r.   r/   r0   r1   r2   r3   r4   r5   r6   r7   r8   r9   r:   r;   r<   r=   r>   r?   r@   rA   rB   rC   rD   r   r   N)OÚ
__future__r   Údatasetr   Ú
decoratorsr   Údistributedr   r   r	   r
   r   Úenvironmentr   r   r   r   r   r   r   Úfile_ior   r   r   r   r   Úhard_negativesr   Úloggingr   r   Úmiscr   r   r   r   r   r    r!   r"   r#   Úquantizationr$   Ú	retrievalr%   r&   r'   r(   r)   Ú
similarityr*   r+   r,   r-   r.   r/   r0   r1   r2   r3   r4   r5   r6   r7   r8   Útensorr9   r:   r;   r<   r=   r>   r?   r@   rA   rB   rC   rD   Ú__all__© ó    úQC:\Projects\DSCons\.venv\Lib\site-packages\sentence_transformers\util\__init__.pyú<module>rV      s,  ðØ "Ð "Ð "Ð "Ð "Ð "à  Ð  Ð  Ð  Ð  Ð  Ø 2Ð 2Ð 2Ð 2Ð 2Ð 2Ø fÐ fÐ fÐ fÐ fÐ fÐ fÐ fÐ fÐ fÐ fÐ fÐ fÐ fðð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð kÐ jÐ jÐ jÐ jÐ jÐ jÐ jÐ jÐ jÐ jÐ jÐ jÐ jØ /Ð /Ð /Ð /Ð /Ð /Ø 3Ð 3Ð 3Ð 3Ð 3Ð 3Ð 3Ð 3ð
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð .Ð -Ð -Ð -Ð -Ð -ðð ð ð ð ð ð ð ð ð ð ð ð ð ðð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð"ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ðMð Mð M€€€rT   