QwenLM / Qwen

The official repo of Qwen (通义千问) chat & pretrained large language model proposed by Alibaba Cloud.
Apache License 2.0
13.59k stars 1.11k forks source link

File "finetune.py", line 412, in <module> train() File "finetune.py", line 384, in train model = get_peft_model(model, lora_config) File "/opt/conda/envs/qwen/lib/python3.8/site-packages/peft/mapping.py", line 123, in get_peft_model peft_config.base_model_name_or_path = model.__dict__.get("name_or_path", None) AttributeError: 'NoneType' object has no attribute '__dict__'[BUG] <title> #1248

Closed sunyclj closed 4 months ago

sunyclj commented 4 months ago

是否已有关于该错误的issue或讨论? | Is there an existing issue / discussion for this?

该问题是否在FAQ中有解答? | Is there an existing answer for this in FAQ?

当前行为 | Current Behavior

运行环境如下: accelerate 0.30.1 addict 2.4.0 aiohttp 3.9.5 aiosignal 1.3.1 aliyun-python-sdk-core 2.15.1 aliyun-python-sdk-kms 2.16.3 annotated-types 0.6.0 async-timeout 4.0.3 attrs 23.2.0 certifi 2024.2.2 cffi 1.16.0 charset-normalizer 3.3.2 crcmod 1.7 cryptography 42.0.7 datasets 2.18.0 deepspeed 0.14.2 dill 0.3.8 einops 0.8.0 filelock 3.14.0 frozenlist 1.4.1 fsspec 2024.2.0 gast 0.5.4 hjson 3.1.0 huggingface-hub 0.23.0 idna 3.7 importlib_metadata 7.1.0 Jinja2 3.1.4 jmespath 0.10.0 MarkupSafe 2.1.5 modelscope 1.14.0 mpmath 1.3.0 multidict 6.0.5 multiprocess 0.70.16 networkx 3.1 ninja 1.11.1.1 numpy 1.24.4 nvidia-cublas-cu12 12.1.3.1 nvidia-cuda-cupti-cu12 12.1.105 nvidia-cuda-nvrtc-cu12 12.1.105 nvidia-cuda-runtime-cu12 12.1.105 nvidia-cudnn-cu12 8.9.2.26 nvidia-cufft-cu12 11.0.2.54 nvidia-curand-cu12 10.3.2.106 nvidia-cusolver-cu12 11.4.5.107 nvidia-cusparse-cu12 12.1.0.106 nvidia-nccl-cu12 2.20.5 nvidia-nvjitlink-cu12 12.4.127 nvidia-nvtx-cu12 12.1.105 oss2 2.18.5 packaging 24.0 pandas 2.0.3 peft 0.7.1 pillow 10.3.0 pip 24.0 platformdirs 4.2.1 psutil 5.9.8 py-cpuinfo 9.0.0 pyarrow 16.0.0 pyarrow-hotfix 0.6 pycparser 2.22 pycryptodome 3.20.0 pydantic 1.10.15 pydantic_core 2.18.2 pynvml 11.5.0 python-dateutil 2.9.0.post0 pytz 2024.1 PyYAML 6.0.1 regex 2024.5.10 requests 2.31.0 safetensors 0.4.3 scipy 1.10.1 setuptools 69.5.1 simplejson 3.19.2 six 1.16.0 sortedcontainers 2.4.0 sympy 1.12 tiktoken 0.6.0 tokenizers 0.13.3 tomli 2.0.1 torch 2.3.0 tqdm 4.66.4 transformers 4.32.0 transformers-stream-generator 0.0.4 triton 2.3.0 typing_extensions 4.11.0 tzdata 2024.1 urllib3 2.2.1 wheel 0.43.0 xxhash 3.4.1 yapf 0.40.2 yarl 1.9.4 zipp 3.18.1 执行单GPU微调报错: File "finetune.py", line 412, in train() File "finetune.py", line 384, in train model = get_peft_model(model, lora_config) File "/opt/conda/envs/qwen/lib/python3.8/site-packages/peft/mapping.py", line 123, in get_peft_model peft_config.base_model_name_or_path = model.dict.get("name_or_path", None) AttributeError: 'NoneType' object has no attribute 'dict' 请问会是什么原因呢?是什么库的版本冲突了嘛?

期望行为 | Expected Behavior

No response

复现方法 | Steps To Reproduce

No response

运行环境 | Environment

- OS:
- Python:
- Transformers:
- PyTorch:
- CUDA (`python -c 'import torch; print(torch.version.cuda)'`):

备注 | Anything else?

No response

jklj077 commented 4 months ago

It appears that the finetune.py does not match the version provided in this repo. Have you changed anything else? Especially, how did you load the model?

jklj077 commented 4 months ago

As Qwen1.0 is no longer actively maintained, we kindly ask to you migrate to Qwen1.5 and direct your related question there. Thanks for you cooperation.