xlang-ai / instructor-embedding

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

Kernel dies when calling HuggingFaceInstructEmbedding #73

Closed lavalosan closed 9 months ago

lavalosan commented 1 year ago

Hi, I am trying to execute this cell on a Jupiter notebook (python 3.9.16)

`from langchain.embeddings import HuggingFaceInstructEmbeddings from tqdm import tqdm

instructor_embeddings = HuggingFaceInstructEmbeddings(model_name = "hkunlp/instructor-xl", model_kwargs = {"device" : "cpu"})`

at first the cell produces :

load INSTRUCTOR_Transformer

then after a few seconds :

Cannot execute code, session has been disposed. Please try restarting the Kernel. The Kernel crashed while executing code in the the current cell or a previous cell. Please review the code in the cell(s) to identify a possible cause of the failure.

Do you know what could be the cause of this Jupyter error ?

hongjin-su commented 1 year ago

Is it because there is not enough memory for the model?

hongjin-su commented 9 months ago

Feel free to re-open the issue if you have any further questions or comments!