epfml/landmark-attention

Peft module

Closed this issue · 0 comments

I keep getting this error, i folled everythinng step by step (conda create landmark,pip install r) and it tells me i have no module called peft so i install it and then it gives me an error saying
"Traceback (most recent call last):
File "C:\Users\PC\Desktop\landmark-attention-qlora\llama\train_qlora.py", line 14, in
from peft import (
ImportError: cannot import name 'prepare_model_for_kbit_training' from 'peft' (C:\Users\PC\AppData\Local\Programs\Python\Python310\lib\site-packages\peft_init_.py)"

do I need a specific version of peft? It is not in the requirements.txt so I don't know what to install.

Full error:

"
(landmark) C:\Users\PC\Desktop\landmark-attention-qlora\llama>python train_qlora.py --model_name_or_path /home/data/WizardCoder-15B-1.0-GPTQ --output_dir /home/data/WizardCoder-15B-1.0-GPTQ/lora --cache_dir /home/data/hf-cache --per_device_train_batch_size 4--gradient_accumulation_steps 8 --learning_rate 0.00015 --weight_decay 0.1 --logging_steps 1 --warmup_ratio 0.03 --max_steps 200 --bf16 False --tf32 False --group_by_length True --lora_r 64 --lora_alpha 16
Traceback (most recent call last):
File "C:\Users\PC\Desktop\landmark-attention-qlora\llama\train_qlora.py", line 14, in
from peft import (
ModuleNotFoundError: No module named 'peft'

(landmark) C:\Users\PC\Desktop\landmark-attention-qlora\llama>pip install peft
Collecting peft
Using cached peft-0.3.0-py3-none-any.whl (56 kB)
Requirement already satisfied: transformers in c:\users\pc\appdata\local\programs\python\python310\lib\site-packages (from peft) (4.30.2)
Requirement already satisfied: accelerate in c:\users\pc\appdata\local\programs\python\python310\lib\site-packages (from peft) (0.20.3)
Requirement already satisfied: pyyaml in c:\users\pc\appdata\local\programs\python\python310\lib\site-packages (from peft) (6.0)
Requirement already satisfied: numpy>=1.17 in c:\users\pc\appdata\local\programs\python\python310\lib\site-packages (from peft) (1.24.3)
Requirement already satisfied: torch>=1.13.0 in c:\users\pc\appdata\local\programs\python\python310\lib\site-packages (from peft) (2.0.0+cu118)
Requirement already satisfied: packaging>=20.0 in c:\users\pc\appdata\local\programs\python\python310\lib\site-packages (from peft) (23.1)
Requirement already satisfied: psutil in c:\users\pc\appdata\local\programs\python\python310\lib\site-packages (from peft) (5.9.5)
Requirement already satisfied: jinja2 in c:\users\pc\appdata\local\programs\python\python310\lib\site-packages (from torch>=1.13.0->peft) (3.1.2)
Requirement already satisfied: sympy in c:\users\pc\appdata\local\programs\python\python310\lib\site-packages (from torch>=1.13.0->peft) (1.12)
Requirement already satisfied: typing-extensions in c:\users\pc\appdata\local\programs\python\python310\lib\site-packages (from torch>=1.13.0->peft) (4.6.3)
Requirement already satisfied: filelock in c:\users\pc\appdata\local\programs\python\python310\lib\site-packages (from torch>=1.13.0->peft) (3.12.1)
Requirement already satisfied: networkx in c:\users\pc\appdata\local\programs\python\python310\lib\site-packages (from torch>=1.13.0->peft) (3.1)
Requirement already satisfied: tqdm>=4.27 in c:\users\pc\appdata\local\programs\python\python310\lib\site-packages (from transformers->peft) (4.65.0)
Requirement already satisfied: requests in c:\users\pc\appdata\local\programs\python\python310\lib\site-packages (from transformers->peft) (2.31.0)
Requirement already satisfied: tokenizers!=0.11.3,<0.14,>=0.11.1 in c:\users\pc\appdata\local\programs\python\python310\lib\site-packages (from transformers->peft) (0.13.3)
Requirement already satisfied: safetensors>=0.3.1 in c:\users\pc\appdata\local\programs\python\python310\lib\site-packages (from transformers->peft) (0.3.1)
Requirement already satisfied: huggingface-hub<1.0,>=0.14.1 in c:\users\pc\appdata\local\programs\python\python310\lib\site-packages (from transformers->peft) (0.15.1)
Requirement already satisfied: regex!=2019.12.17 in c:\users\pc\appdata\local\programs\python\python310\lib\site-packages (from transformers->peft) (2023.6.3)
Requirement already satisfied: fsspec in c:\users\pc\appdata\local\programs\python\python310\lib\site-packages (from huggingface-hub<1.0,>=0.14.1->transformers->peft) (2023.6.0)
Requirement already satisfied: colorama in c:\users\pc\appdata\local\programs\python\python310\lib\site-packages (from tqdm>=4.27->transformers->peft) (0.4.6)
Requirement already satisfied: MarkupSafe>=2.0 in c:\users\pc\appdata\local\programs\python\python310\lib\site-packages (from jinja2->torch>=1.13.0->peft) (2.1.3)
Requirement already satisfied: urllib3<3,>=1.21.1 in c:\users\pc\appdata\local\programs\python\python310\lib\site-packages (from requests->transformers->peft) (1.26.16)
Requirement already satisfied: charset-normalizer<4,>=2 in c:\users\pc\appdata\local\programs\python\python310\lib\site-packages (from requests->transformers->peft) (2.1.1)
Requirement already satisfied: certifi>=2017.4.17 in c:\users\pc\appdata\local\programs\python\python310\lib\site-packages (from requests->transformers->peft) (2023.5.7)
Requirement already satisfied: idna<4,>=2.5 in c:\users\pc\appdata\local\programs\python\python310\lib\site-packages (from requests->transformers->peft) (3.4)
Requirement already satisfied: mpmath>=0.19 in c:\users\pc\appdata\local\programs\python\python310\lib\site-packages (from sympy->torch>=1.13.0->peft) (1.3.0)
Installing collected packages: peft
Successfully installed peft-0.3.0

[notice] A new release of pip available: 22.3.1 -> 23.1.2
[notice] To update, run: python.exe -m pip install --upgrade pip

(landmark) C:\Users\PC\Desktop\landmark-attention-qlora\llama>python train_qlora.py --model_name_or_path /home/data/WizardCoder-15B-1.0-GPTQ --output_dir /home/data/WizardCoder-15B-1.0-GPTQ/lora --cache_dir /home/data/hf-cache --per_device_train_batch_size 4--gradient_accumulation_steps 8 --learning_rate 0.00015 --weight_decay 0.1 --logging_steps 1 --warmup_ratio 0.03 --max_steps 200 --bf16 False --tf32 False --group_by_length True --lora_r 64 --lora_alpha 16
Traceback (most recent call last):
File "C:\Users\PC\Desktop\landmark-attention-qlora\llama\train_qlora.py", line 14, in
from peft import (
ImportError: cannot import name 'prepare_model_for_kbit_training' from 'peft' (C:\Users\PC\AppData\Local\Programs\Python\Python310\lib\site-packages\peft_init_.py)

(landmark) C:\Users\PC\Desktop\landmark-attention-qlora\llama>
"