Skip to content

Commit

Permalink
Remove module, fix code
Browse files Browse the repository at this point in the history
  • Loading branch information
matgille committed Apr 19, 2024
1 parent d9c7367 commit 03d5a8a
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 17 deletions.
13 changes: 0 additions & 13 deletions aquilign/align/bertalign/Bertalign.py

This file was deleted.

4 changes: 0 additions & 4 deletions aquilign/align/bertalign/corelib.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 03d5a8a

Please sign in to comment.