添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
相关文章推荐
深沉的黑框眼镜  ·  python - ...·  4 周前    · 
威武的茴香  ·  执行命令./configure ...·  2 周前    · 
英勇无比的脸盆  ·  Altium Designer 17 ...·  4 天前    · 
耍酷的鸡蛋面  ·  Python:numpy ...·  5 月前    · 
俊秀的花卷  ·  android_os_DeadObjectE ...·  8 月前    · 

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement . We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account Could not import sentence_transformers python package. Please install it with pip install sentence_transformers . Could not import sentence_transformers python package. Please install it with pip install sentence_transformers . wengieeee opened this issue May 18, 2023 · 16 comments

问题描述 / Problem Description
执行报错,无法上传知识库
ERROR 2023-05-18 14:08:12,342-1d: Could not import sentence_transformers python package. Please install it with pip install sentence_transformers .

复现问题的步骤 / Steps to Reproduce
python webui.py

实际结果 / Actual Result
(/mnt/data/deploy/venv_lc2) [root@OneThingEdgeCloud langchain-ChatGLM]# python webui.py
INFO 2023-05-18 14:07:41,687-1d:
loading model config
llm device: cuda
embedding device: cuda
dir: /mnt/data/code/langchain-ChatGLM
flagging username: 054012f1800641b593a81535730d2626

/mnt/data/deploy/venv_lc2/lib/python3.10/site-packages/paddle/fluid/core.py:219: UserWarning: Load /lib64/libgomp.so.1 failed
warnings.warn("Load {} failed".format(dso_absolute_path))
Explicitly passing a revision is encouraged when loading a model with custom code to ensure no malicious code has been contributed in a newer revision.
Explicitly passing a revision is encouraged when loading a configuration with custom code to ensure no malicious code has been contributed in a newer revision.
Explicitly passing a revision is encouraged when loading a model with custom code to ensure no malicious code has been contributed in a newer revision.
Loading checkpoint shards: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████| 8/8 [00:07<00:00, 1.05it/s]
ERROR 2023-05-18 14:08:12,342-1d: Could not import sentence_transformers python package. Please install it with pip install sentence_transformers .
Running on local URL: http://0.0.0.0:7860
Running on public URL: https://7e8ac414467778dcf4.gradio.live

This share link expires in 72 hours. For free permanent hosting and GPU upgrades (NEW!), check out Spaces: https://huggingface.co/spaces

环境信息 / Environment Information

  • langchain-ChatGLM 版本/commit 号:master
  • 是否使用 Docker 部署(是/否):否
  • 使用的模型(ChatGLM-6B / ClueAI/ChatYuan-large-v2 等):ChatGLM-6B
  • 使用的 Embedding 模型(GanymedeNil/text2vec-large-chinese 等):GanymedeNil/text2vec-large-chinese
  • 操作系统及版本 / Operating system and version: centOS 7.9
  • Python 版本 / Python version: 3.10
  • 其他相关环境信息 / Other relevant environment information: gcc 4.8 ,如果使用gcc 10 会报段错误
  • 附加信息 / Additional Information
    gradio 可以正常启动,但是上传的上传知识库并不生效,没有生成 vector_store 文件夹

    | Cc | ***@***.***> , ***@***.***> | | Subject | Re: [imClumsyPanda/langchain-ChatGLM] Could not import sentence_transformers python package. Please install it with `pip install sentence_transformers`. (Issue #400 ) | ***@***.***:/workspace/langchain-ChatGLM-master# pip install sentence-transformers Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple/ , https://pypi.ngc.nvidia.com Requirement already satisfied: sentence-transformers in /usr/local/lib/python3.8/dist-packages (2.2.2) Requirement already satisfied: transformers<5.0.0,>=4.6.0 in /usr/local/lib/python3.8/dist-packages (from sentence-transformers) (4.29.1) Requirement already satisfied: tqdm in /usr/local/lib/python3.8/dist-packages (from sentence-transformers) (4.65.0) Requirement already satisfied: torch>=1.6.0 in /usr/local/lib/python3.8/dist-packages (from sentence-transformers) (2.0.0a0+1767026) Requirement already satisfied: torchvision in /usr/local/lib/python3.8/dist-packages (from sentence-transformers) (0.15.0a0) Requirement already satisfied: numpy in /usr/local/lib/python3.8/dist-packages (from sentence-transformers) (1.23.5) Requirement already satisfied: scikit-learn in /usr/local/lib/python3.8/dist-packages (from sentence-transformers) (1.2.0) Requirement already satisfied: scipy in /usr/local/lib/python3.8/dist-packages (from sentence-transformers) (1.10.1) Requirement already satisfied: nltk in /usr/local/lib/python3.8/dist-packages (from sentence-transformers) (3.8.1) Requirement already satisfied: sentencepiece in /usr/local/lib/python3.8/dist-packages (from sentence-transformers) (0.1.99) Requirement already satisfied: huggingface-hub>=0.4.0 in /usr/local/lib/python3.8/dist-packages (from sentence-transformers) (0.16.4) Requirement already satisfied: filelock in /usr/local/lib/python3.8/dist-packages (from huggingface-hub>=0.4.0->sentence-transformers) (3.10.0) Requirement already satisfied: fsspec in /usr/local/lib/python3.8/dist-packages (from huggingface-hub>=0.4.0->sentence-transformers) (2023.1.0) Requirement already satisfied: requests in /usr/local/lib/python3.8/dist-packages (from huggingface-hub>=0.4.0->sentence-transformers) (2.28.2) Requirement already satisfied: pyyaml>=5.1 in /usr/local/lib/python3.8/dist-packages (from huggingface-hub>=0.4.0->sentence-transformers) (6.0) Requirement already satisfied: typing-extensions>=3.7.4.3 in /usr/local/lib/python3.8/dist-packages (from huggingface-hub>=0.4.0->sentence-transformers) (4.5.0) Requirement already satisfied: packaging>=20.9 in /usr/local/lib/python3.8/dist-packages (from huggingface-hub>=0.4.0->sentence-transformers) (23.0) Requirement already satisfied: sympy in /usr/local/lib/python3.8/dist-packages (from torch>=1.6.0->sentence-transformers) (1.11.1) Requirement already satisfied: networkx in /usr/local/lib/python3.8/dist-packages (from torch>=1.6.0->sentence-transformers) (3.1) Requirement already satisfied: regex!=2019.12.17 in /usr/local/lib/python3.8/dist-packages (from transformers<5.0.0,>=4.6.0->sentence-transformers) (2022.10.31) Requirement already satisfied: tokenizers!=0.11.3,<0.14,>=0.11.1 in /usr/local/lib/python3.8/dist-packages (from transformers<5.0.0,>=4.6.0->sentence-transformers) (0.13.3) Requirement already satisfied: click in /usr/local/lib/python3.8/dist-packages (from nltk->sentence-transformers) (8.1.3) Requirement already satisfied: joblib in /usr/local/lib/python3.8/dist-packages (from nltk->sentence-transformers) (1.2.0) Requirement already satisfied: threadpoolctl>=2.0.0 in /usr/local/lib/python3.8/dist-packages (from scikit-learn->sentence-transformers) (3.1.0) Requirement already satisfied: pillow!=8.3.*,>=5.3.0 in /usr/local/lib/python3.8/dist-packages (from torchvision->sentence-transformers) (9.2.0) Requirement already satisfied: charset-normalizer<4,>=2 in /usr/local/lib/python3.8/dist-packages (from requests->huggingface-hub>=0.4.0->sentence-transformers) (2.1.0) Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.8/dist-packages (from requests->huggingface-hub>=0.4.0->sentence-transformers) (3.4) Requirement already satisfied: urllib3<1.27,>=1.21.1 in /usr/local/lib/python3.8/dist-packages (from requests->huggingface-hub>=0.4.0->sentence-transformers) (1.26.14) Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.8/dist-packages (from requests->huggingface-hub>=0.4.0->sentence-transformers) (2022.12.7) Requirement already satisfied: mpmath>=0.19 in /usr/local/lib/python3.8/dist-packages (from sympy->torch>=1.6.0->sentence-transformers) (1.3.0) sentence-transformers是安装了的 Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: ***@***.***>

    同遇到了类似的问题,并且执行pip install sentence-transformers以及sklearn后也没有解决这个问题
    Traceback (most recent call last):
    File "/home/users/xxxx/anaconda3/envs/chatglm/lib/python3.8/site-packages/sklearn/__check_build/ init .py", line 45, in
    from ._check_build import check_build # noqa
    ImportError: dlopen: cannot load any more object with static TLS

    我看到有这个错误
    ImportError: accelerate>=0.20.3 is required for a normal functioning of this module, but found accelerate==0.18.0.

    但是pip install accelerate>=0.20.3不管用
    先pip uninstall accelerate再pip install accelerate>=0.20.3可以

    没再报找不到sentence_transformers