xlang-ai / instructor-embedding

[ACL 2023] One Embedder, Any Task: Instruction-Finetuned Text Embeddings
Apache License 2.0
1.79k stars 132 forks source link

show_progress_bar = True does not work properly in notebook #50

Closed rmovva closed 11 months ago

rmovva commented 1 year ago

Hi,

Thank you for this model. I'm running model.encode() in a Jupyter notebook on VSCode. It works fine at generating the embeddings, however when I try using the progress bar (show_progress_bar = True), no progress bar shows up in the VS Code notebook cell output, and the cell also hangs (it does not finish running, even when the embeddings have been generated).

When I try interrupting the cell in VSC, it says: "Interrupting the kernel timed out. Do you want to restart the kernel instead? All variables will be lost." After restarting the kernel, the output shows up.

Another potentially relevant piece of context is that when I initialize the model, I get the following warning

TqdmExperimentalWarning: Using `tqdm.autonotebook.tqdm` in notebook mode. Use `tqdm.tqdm` instead to force console mode (e.g. in jupyter console)
  from tqdm.autonotebook import trange

I'm not sure what's causing this behavior, but wondering if you have any thoughts/suggestions. Thanks!

hongjin-su commented 1 year ago

Have you tried to use other sentence transformer models for generating embeddings, e.g., https://huggingface.co/sentence-transformers/all-MiniLM-L6-v2? Will the progress bar be shown?

hongjin-su commented 11 months ago

Please re-open the issue if you have any questions or comments!