[THUDM/ChatGLM-6B][BUG/Help] 在windows部署,做ptuning训练时,下载好数据集,执行bash train.sh的时候报错

2024-05-20 556 views
4

train.sh: line 3: $'\r': command not found Traceback (most recent call last): File "/mnt/e/cqy-gpt/gpt-fine-tune/ChatGLM-6B/ptuning/main.py", line 26, in import numpy as np ModuleNotFoundError: No module named 'numpy' train.sh: line 5: --do_train: command not found train.sh: line 6: --train_file: command not found train.sh: line 7: --validation_file: command not found train.sh: line 8: --prompt_column: command not found train.sh: line 9: --response_column: command not found train.sh: line 10: --overwrite_cache: command not found train.sh: line 11: --model_name_or_path: command not found train.sh: line 12: --output_dir: command not found train.sh: line 13: --overwrite_output_dir: command not found train.sh: line 14: --max_source_length: command not found train.sh: line 15: --max_target_length: command not found train.sh: line 16: --per_device_train_batch_size: command not found train.sh: line 17: --per_device_eval_batch_size: command not found train.sh: line 18: --gradient_accumulation_steps: command not found train.sh: line 19: --predict_with_generate: command not found train.sh: line 20: --max_steps: command not found train.sh: line 21: --logging_steps: command not found train.sh: line 22: --save_steps: command not found train.sh: line 23: --learning_rate: command not found train.sh: line 24: --pre_seq_len: command not found train.sh: line 25: --quantization_bit: command not found train.sh: line 26: $'\r': command not found

  1. git clone https://github.com/THUDM/ChatGLM-6B.git
  2. 下载chatglm的模型
  3. 下载ADGEN数据
  4. cd ptuning
  5. bash train.sh
Environment
- OS:windows 11
- Python:3.10.11
- Transformers:4.27.1
- PyTorch:2.0.0+cpu
- CUDA Support (`python -c "import torch; print(torch.cuda.is_available())"`) :True

回答

1

哥,你先装个环境

1

哥,你先装个环境

我按照要求装了环境的。但是没有办法正常使用*.sh的脚本。我现在的解决方法就是:

  1. 直接在terminal里面输入python main.py --do_train --train_file AdvertiseGen/train.json --validation_file AdvertiseGen/dev.json --prompt_column content --response_column summary --overwrite_cache --model_name_or_path E:\cqy-gpt\gpt-fine-tune\ChatGLM-6B\chatglm-6b --output_dir output/adgen-chatglm-6b-pt-128-2e-2 --overwrite_output_dir --max_source_length 64 --max_target_length 64 --per_device_train_batch_size 1 --per_device_eval_batch_size 1 --gradient_accumulation_steps 16 --predict_with_generate --max_steps 3000 --logging_steps 10 --save_steps 1000 --learning_rate 2e-2 --pre_seq_len 128 --quantization_bit 4
  2. 我在我的Ubuntu服务器上,是可以正常使用的。
1

老哥 现在能正常使用了吗 我也是这个问题

1

官方的sh文件的换行符都是win系统的吧,我在linux里用vi重打了一遍就好了

9

老哥 现在能正常使用了吗 我也是这个问题

用不了,我在windows上不能正常用,用了wsl之后可以