OpenMOSS / MOSS

An open-source tool-augmented conversational language model from Fudan University
https://txsun1997.github.io/blogs/moss.html
Apache License 2.0
11.92k stars 1.14k forks source link

has no attribute 'MossForCausalLM' #258

Closed sk142857 closed 1 year ago

sk142857 commented 1 year ago

第一个问题:No module named 'transformers_modules.local.custom_autotune'

参考212 解决了。

第二个问题:AttributeError: module 'transformers_modules.local.modeling_moss' has no attribute 'MossForCausalLM'

第三个问题:

RuntimeError: `<class 'transformers_modules.local.quantization.QuantLinear'>' was not properly set up for sharding by 
zero.Init(). A subclass of torch.nn.Module must be defined before zero.Init() where an instance of the class is created.

麻烦大佬看看怎么设置参数,运行一直报错。

硬件环境:RTX A5000(24GB) * 3

num_machines=1
num_processes=$((num_machines * 3))
machine_rank=0

accelerate launch \
    --config_file ./configs/sft.yaml \
    --num_processes $num_processes \
    --num_machines $num_machines \
    --machine_rank $machine_rank \
    --deepspeed_multinode_launcher standard finetune_moss.py \
    --model_name_or_path /root/autodl-tmp/moss/fnlp/moss-moon-003-sft-int4 \
    --data_dir ./sft_data \
    --output_dir ./ckpts/moss-moon-003-sft \
    --log_dir ./train_logs/moss-moon-003-sft \
    --n_epochs 2 \
    --train_bsz_per_gpu 3 \
    --eval_bsz_per_gpu 3 \
    --learning_rate 0.000015 \
    --eval_step 200 \
    --save_step 2000

报错截图

image

image

WenjingBao commented 1 year ago

您好,能请问一下您是怎么解决最后一个bug的吗?我也遇到了一样的报错: RuntimeError:<class 'transformers_modules.local.quantization.QuantLinear'>' was not properly set up for sharding by zero.Init(). A subclass of torch.nn.Module must be defined before zero.Init() where an instance of the class is created.` 感谢