question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SentenceTransformer hangs

See original GitHub issue

Packages:

!pip install -q git+https://github.com/UKPLab/sentence-transformers.git
!pip install -q git+https://github.com/embeddings-benchmark/mteb.git
!pip install -q git+https://github.com/NouamaneTazi/beir.git@fix_drpes_ids
!pip install -q evaluate

Doing

import time
from mteb import MTEB
from sentence_transformers import SentenceTransformer

class SentenceTransformerX(SentenceTransformer):
  pass

model_name = "sentence-transformers/average_word_embeddings_komninos"


model = SentenceTransformerX(model_name)
evaluation = MTEB(tasks=["SciFact"])
a = time.time()
results = evaluation.run(model, output_folder=f"results/{model_name}", overwrite_results=True)
b = time.time()

hangs at

 p = ctx.Process(
                target=SentenceTransformer._encode_multi_process_worker,
                args=(process_id, device_name, self.model, input_queue, output_queue),
                daemon=True,
            )

I think you’re the expert here - any ideas? @NouamaneTazi

This only affects the latest BEIR, i.e. I think it has something to do with DPRES. Using the below is fine

!pip install -q git+https://github.com/UKPLab/sentence-transformers.git
!pip install -q git+https://github.com/embeddings-benchmark/mteb.git
!pip install beir==1.0.0

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:11 (10 by maintainers)

github_iconTop GitHub Comments

2reactions
Muennighoffcommented, Nov 8, 2022

beir==1.0.0

Yeah this PR would fix it: https://github.com/embeddings-benchmark/mteb/pull/86 by not using the parallel processor added to BEIR in 1.0.1. The only disadvantage is it will remove the possibility to run on multiple GPUs (It will just use 1 GPU).

1reaction
Muennighoffcommented, Sep 18, 2022

Should we close this?

Hmm it’s not really solved, is it? I’m not sure whether it’s a MTEB / BeIR / SentenceTransformers or Python limitation?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Sentence Transformers: encode() hangs forever in uwsgi ...
Hi @nreimers While building a search engine using the Sentence Transformers library, I'm using pretrained models.
Read more >
SentenceTransformer — Sentence-Transformers documentation
If it is not a path, it first tries to download a pre-trained SentenceTransformer model. If that fails, tries to construct a model...
Read more >
Bert sentence-transformers stops/quits during fine tuning
My solution was to set batch and worker to one and its very slow train_dataloader = DataLoader(train_dataset, shuffle=False, batch_size=1, ...
Read more >
SentenceTransformer - float object is not subscriptable
I was trying to apply the SentenceTransformer (v2.2.0) on a list of custom documents to create embeddings for each of them, however i...
Read more >
English-Vietnamese Cross-lingual Semantic Textual Similarity ...
... Cross-lingual Semantic Textual Similarity using Sentence Transformer model ... Khang Huu Nguyen ; Dat Cong Dinh ; Hang Thi-Thuy Le ; Dien...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found