From 03d5a8ad7c3d70180ebf728cecf48b3c386fe0c7 Mon Sep 17 00:00:00 2001 From: Matthias Gille Levenson Date: Fri, 19 Apr 2024 17:32:17 +0200 Subject: [PATCH] Remove module, fix code --- aquilign/align/bertalign/Bertalign.py | 13 ------------- aquilign/align/bertalign/corelib.py | 4 ---- 2 files changed, 17 deletions(-) delete mode 100644 aquilign/align/bertalign/Bertalign.py diff --git a/aquilign/align/bertalign/Bertalign.py b/aquilign/align/bertalign/Bertalign.py deleted file mode 100644 index 27ed30a..0000000 --- a/aquilign/align/bertalign/Bertalign.py +++ /dev/null @@ -1,13 +0,0 @@ -""" -Bertalign initialization -""" - -__author__ = "Jason (bfsujason@163.com)" -__version__ = "1.1.0" - -# from sonar.inference_pipelines.text import TextToEmbeddingModelPipeline -# See other cross-lingual embedding models at -# https://www.sbert.net/docs/pretrained_models.html -print("Chargement 1") - - diff --git a/aquilign/align/bertalign/corelib.py b/aquilign/align/bertalign/corelib.py index 77228e2..d900ee0 100644 --- a/aquilign/align/bertalign/corelib.py +++ b/aquilign/align/bertalign/corelib.py @@ -390,16 +390,12 @@ def find_top_k_sents(src_vecs, tgt_vecs, k=3, device='cpu'): """ embedding_size = src_vecs.shape[1] if torch.cuda.is_available() and platform == 'linux' and device != "cpu": # GPU version - print("OK") - exit(0) res = faiss.StandardGpuResources() index = faiss.IndexFlatIP(embedding_size) gpu_index = faiss.index_cpu_to_gpu(res, 0, index) gpu_index.add(tgt_vecs) D, I = gpu_index.search(src_vecs, k) else: # CPU version - print("Not OK") - exit(0) index = faiss.IndexFlatIP(embedding_size) index.add(tgt_vecs) D, I = index.search(src_vecs, k)