Facico / Chinese-Vicuna

Chinese-Vicuna: A Chinese Instruction-following LLaMA-based Model —— 一个中文低资源的llama+lora方案,结构参考alpaca
https://github.com/Facico/Chinese-Vicuna
Apache License 2.0
4.14k stars 425 forks source link

环境问题,不太理解.. #43

Closed bambooqj closed 1 year ago

bambooqj commented 1 year ago
Successfully built transformers
Installing collected packages: transformers
Successfully installed transformers-4.28.0.dev0
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
root@PC-202209111204:/mnt/e/Chinese-Vicuna# python3 ./Chinese-Vicuna/generate.py --model_path decapoda-research/llama-7b-hf --lora_path Facico/Chinese-Vicuna-lora-7b-3epoch-belle-and-guanaco --use_local 0
Traceback (most recent call last):
  File "/mnt/e/Chinese-Vicuna/./Chinese-Vicuna/generate.py", line 3, in <module>
    from peft import PeftModel, PeftModelForCausalLM, LoraConfig
  File "/usr/local/lib/python3.10/dist-packages/peft/__init__.py", line 22, in <module>
    from .mapping import MODEL_TYPE_TO_PEFT_MODEL_MAPPING, PEFT_TYPE_TO_CONFIG_MAPPING, get_peft_config, get_peft_model
  File "/usr/local/lib/python3.10/dist-packages/peft/mapping.py", line 16, in <module>
    from .peft_model import (
  File "/usr/local/lib/python3.10/dist-packages/peft/peft_model.py", line 27, in <module>
    from transformers import PreTrainedModel
ModuleNotFoundError: No module named 'transformers'

我已经正确安装了这个库.

Package                  Version
------------------------ ---------------
accelerate               0.18.0
aiofiles                 23.1.0
aiohttp                  3.8.4
aiosignal                1.3.1
altair                   4.2.2
anyio                    3.6.2
appdirs                  1.4.4
async-timeout            4.0.2
attrs                    21.2.0
Automat                  20.2.0
Babel                    2.8.0
bcrypt                   3.2.0
bitsandbytes             0.37.2
blinker                  1.4
certifi                  2020.6.20
chardet                  4.0.0
charset-normalizer       3.1.0
click                    8.0.3
cloud-init               22.2
cmake                    3.26.1
colorama                 0.4.4
command-not-found        0.3
configobj                5.0.6
constantly               15.1.0
contourpy                1.0.7
cryptography             3.4.8
cycler                   0.11.0
datasets                 2.11.0
dbus-python              1.2.18
dill                     0.3.6
distro                   1.7.0
distro-info              1.1build1
entrypoints              0.4
fastapi                  0.95.0
ffmpy                    0.3.0
filelock                 3.10.7
fonttools                4.39.3
frozenlist               1.3.3
fsspec                   2023.3.0
gradio                   3.24.1
gradio_client            0.0.7
h11                      0.14.0
httpcore                 0.16.3
httplib2                 0.20.2
httpx                    0.23.3
huggingface-hub          0.13.4
hyperlink                21.0.0
idna                     3.3
importlib-metadata       4.6.4
incremental              21.3.0
jeepney                  0.7.1
Jinja2                   3.0.3
jsonpatch                1.32
jsonpointer              2.0
jsonschema               3.2.0
keyring                  23.5.0
kiwisolver               1.4.4
launchpadlib             1.10.16
lazr.restfulclient       0.14.4
lazr.uri                 1.0.6
linkify-it-py            2.0.0
lit                      16.0.0
loralib                  0.1.1
markdown-it-py           2.2.0
MarkupSafe               2.0.1
matplotlib               3.7.1
mdit-py-plugins          0.3.3
mdurl                    0.1.2
more-itertools           8.10.0
mpmath                   1.3.0
multidict                6.0.4
multiprocess             0.70.14
netifaces                0.11.0
networkx                 3.1
numpy                    1.24.2
nvidia-cublas-cu11       11.10.3.66
nvidia-cuda-cupti-cu11   11.7.101
nvidia-cuda-nvrtc-cu11   11.7.99
nvidia-cuda-runtime-cu11 11.7.99
nvidia-cudnn-cu11        8.5.0.96
nvidia-cufft-cu11        10.9.0.58
nvidia-curand-cu11       10.2.10.91
nvidia-cusolver-cu11     11.4.0.1
nvidia-cusparse-cu11     11.7.4.91
nvidia-nccl-cu11         2.14.3
nvidia-nvtx-cu11         11.7.91
oauthlib                 3.2.0
orjson                   3.8.9
packaging                23.0
pandas                   2.0.0
peft                     0.3.0.dev0
pexpect                  4.8.0
Pillow                   9.5.0
pip                      22.0.2
psutil                   5.9.4
ptyprocess               0.7.0
pyarrow                  11.0.0
pyasn1                   0.4.8
pyasn1-modules           0.2.1
pydantic                 1.10.7
pydub                    0.25.1
PyGObject                3.42.1
PyHamcrest               2.0.2
PyJWT                    2.4.0
pyOpenSSL                21.0.0
pyparsing                2.4.7
pyrsistent               0.18.1
pyserial                 3.5
python-apt               2.3.0+ubuntu2.1
python-dateutil          2.8.2
python-debian            0.1.43ubuntu1
python-multipart         0.0.6
pytz                     2022.1
PyYAML                   5.4.1
regex                    2023.3.23
requests                 2.25.1
responses                0.18.0
rfc3986                  1.5.0
SecretStorage            3.3.1
semantic-version         2.10.0
sentencepiece            0.1.97
service-identity         18.1.0
setuptools               59.6.0
six                      1.16.0
sniffio                  1.3.0
sos                      4.3
ssh-import-id            5.11
starlette                0.26.1
sympy                    1.11.1
systemd-python           234
tokenizers               0.13.3
toolz                    0.12.0
torch                    2.0.0
tqdm                     4.65.0
transformers             4.28.0.dev0
triton                   2.0.0
Twisted                  22.1.0
typing_extensions        4.5.0
tzdata                   2023.3
ubuntu-advantage-tools   27.9
uc-micro-py              1.0.1
ufw                      0.36.1
unattended-upgrades      0.1
urllib3                  1.26.5
uvicorn                  0.21.1
wadllib                  1.3.6
websockets               11.0.1
wheel                    0.37.1
xxhash                   3.2.0
yarl                     1.8.2
zipp                     1.0.0
zope.interface           5.4.0

EMMM,我并没有发现问题在哪里...有没有大佬遇到过,求教..环境再wsl下Python 3.10.6.很奇怪..

Facico commented 1 year ago

@bambooqj 我觉得可能的原因是,你的pip对应安装的python环境和你使用的python环境不是一个环境。可以使用whereis python查看一下,看看用的是不是同一个环境。同时你可以检查一下你上面的warning。

bambooqj commented 1 year ago

root@PC:~# whereis python python: root@PC:~# whereis python3 python3: /usr/bin/python3 /usr/lib/python3 /etc/python3 /usr/share/python3 /usr/share/man/man1/python3.1.gz

看起来环境变量没啥问题..

Facico commented 1 year ago

但是,你上面跑的python路径是/usr/local/lib/python3.10?

这个测试不是测试有没有装上python,你要确保你跑的和你pip安装的是同一个东西。