LMFlow icon indicating copy to clipboard operation
LMFlow copied to clipboard

model forgetting

Open snake-head opened this issue 2 years ago • 10 comments

我使用一个医学问答数据集(chatdoctor)来微调robin-7b-v2,即使只训练0.01个epoch,也会导致完全失去对话能力。

数据集形式如下: { "type": "text2text", "instances": [ { "input": "###Human: Hi, I have what feels like a lump in my hip felxor, pretty much in the crease between lower abdominals and top of the quad. One on the right hip is slightly larger than the one on the left hip, and are not in symmetrical positions. When I press on either one they move around slightly, and no real pain just minor discomfort. It almost feels like a knot in a muscle. What could these be? Should I be concerned and should I seek further medical advice?###Assistant:", "output": "Studied your query in full depth of its details. Reviewed it in context of your health concerns. Based On the facts, You mostly seem to suffer from-Lymphnode enlargement in the groin / or could be from Lipoma. Any other causes of such a lump would be more evident after physical and clinical assessment of your lumps in that region. X-ray / USG / CT study would help you out in fixing the cause and nature of such a lump. Surgeon and if need be ortho-Surgeon would help you out in this work up. Hope that, This reply would help you to plan further treatment soon with your treating doctors. Best of Luck and early recovery. Welcome any further query in this regard, which would be replied in next session. N. Senior Surgical Specialist###" }, ] }

训练参数如下: CUDA_VISIBLE_DEVICES=1
deepspeed "--master_port=11000"
examples/finetune.py
--model_name_or_path output_models/merged
--dataset_path /mnt/data.coronaryct.1/ZhuYichen/LMFlow/data/Med100k/train
--output_dir /mnt/data.coronaryct.1/ZhuYichen/LMFlow/output_models/finetune_with_lora --overwrite_output_dir
--num_train_epochs 0.01
--learning_rate 1e-4
--block_size 512
--per_device_train_batch_size 1
--use_lora 1
--lora_r 8
--save_aggregated_lora 0
--deepspeed configs/ds_config_zero3.json
--fp16
--run_name finetune_with_lora
--validation_split_percentage 0
--logging_steps 20
--do_train
--ddp_timeout 72000
--save_steps 5000
--dataloader_num_workers 1
| tee /mnt/data.coronaryct.1/ZhuYichen/LMFlow/log/finetune_with_lora/train.log
2> /mnt/data.coronaryct.1/ZhuYichen/LMFlow/log/finetune_with_lora/train.err

使用chatbot测试: image

我想知道是否是我的设置错误?还是微调有哪些需要注意的点?

snake-head avatar Jun 06 '23 09:06 snake-head

我使用一个医学问答数据集(chatdoctor)来微调robin-7b-v2,即使只训练0.01个epoch,也会导致完全失去对话能力。

数据集形式如下: { "type": "text2text", "instances": [ { "input": "###Human: Hi, I have what feels like a lump in my hip felxor, pretty much in the crease between lower abdominals and top of the quad. One on the right hip is slightly larger than the one on the left hip, and are not in symmetrical positions. When I press on either one they move around slightly, and no real pain just minor discomfort. It almost feels like a knot in a muscle. What could these be? Should I be concerned and should I seek further medical advice?###Assistant:", "output": "Studied your query in full depth of its details. Reviewed it in context of your health concerns. Based On the facts, You mostly seem to suffer from-Lymphnode enlargement in the groin / or could be from Lipoma. Any other causes of such a lump would be more evident after physical and clinical assessment of your lumps in that region. X-ray / USG / CT study would help you out in fixing the cause and nature of such a lump. Surgeon and if need be ortho-Surgeon would help you out in this work up. Hope that, This reply would help you to plan further treatment soon with your treating doctors. Best of Luck and early recovery. Welcome any further query in this regard, which would be replied in next session. N. Senior Surgical Specialist" }, ] }

训练参数如下: CUDA_VISIBLE_DEVICES=1 deepspeed "--master_port=11000" examples/finetune.py --model_name_or_path output_models/merged --dataset_path /mnt/data.coronaryct.1/ZhuYichen/LMFlow/data/Med100k/train --output_dir /mnt/data.coronaryct.1/ZhuYichen/LMFlow/output_models/finetune_with_lora --overwrite_output_dir --num_train_epochs 0.01 --learning_rate 1e-4 --block_size 512 --per_device_train_batch_size 1 --use_lora 1 --lora_r 8 --save_aggregated_lora 0 --deepspeed configs/ds_config_zero3.json --fp16 --run_name finetune_with_lora --validation_split_percentage 0 --logging_steps 20 --do_train --ddp_timeout 72000 --save_steps 5000 --dataloader_num_workers 1 | tee /mnt/data.coronaryct.1/ZhuYichen/LMFlow/log/finetune_with_lora/train.log 2> /mnt/data.coronaryct.1/ZhuYichen/LMFlow/log/finetune_with_lora/train.err

使用chatbot测试: image

我想知道是否是我的设置错误?还是微调有哪些需要注意的点?

Can you provide more details about --model_name_or_path output_models/merged

seanxuu avatar Jun 06 '23 09:06 seanxuu

--model_name_or_path output_models/merged is generated by merging robin-7b-v2-delta and llama-7b as below: python utils/apply_delta.py
--base-model-path pinkmanlove/llama-7b-hf
--delta-path output_models/robin-7b-v2-delta
--target-model-path output_models/merged

And the merged model perfomaced well before finetuning. image

snake-head avatar Jun 06 '23 13:06 snake-head

我使用一个医学问答数据集(chatdoctor)来微调robin-7b-v2,即使只训练0.01个epoch,也会导致完全失去对话能力。

数据集形式如下: { "type": "text2text", "instances": [ { "input": "###Human: Hi, I have what feels like a lump in my hip felxor, pretty much in the crease between lower abdominals and top of the quad. One on the right hip is slightly larger than the one on the left hip, and are not in symmetrical positions. When I press on either one they move around slightly, and no real pain just minor discomfort. It almost feels like a knot in a muscle. What could these be? Should I be concerned and should I seek further medical advice?###Assistant:", "output": "Studied your query in full depth of its details. Reviewed it in context of your health concerns. Based On the facts, You mostly seem to suffer from-Lymphnode enlargement in the groin / or could be from Lipoma. Any other causes of such a lump would be more evident after physical and clinical assessment of your lumps in that region. X-ray / USG / CT study would help you out in fixing the cause and nature of such a lump. Surgeon and if need be ortho-Surgeon would help you out in this work up. Hope that, This reply would help you to plan further treatment soon with your treating doctors. Best of Luck and early recovery. Welcome any further query in this regard, which would be replied in next session. N. Senior Surgical Specialist###" }, ] }

训练参数如下: CUDA_VISIBLE_DEVICES=1 deepspeed "--master_port=11000" examples/finetune.py --model_name_or_path output_models/merged --dataset_path /mnt/data.coronaryct.1/ZhuYichen/LMFlow/data/Med100k/train --output_dir /mnt/data.coronaryct.1/ZhuYichen/LMFlow/output_models/finetune_with_lora --overwrite_output_dir --num_train_epochs 0.01 --learning_rate 1e-4 --block_size 512 --per_device_train_batch_size 1 --use_lora 1 --lora_r 8 --save_aggregated_lora 0 --deepspeed configs/ds_config_zero3.json --fp16 --run_name finetune_with_lora --validation_split_percentage 0 --logging_steps 20 --do_train --ddp_timeout 72000 --save_steps 5000 --dataloader_num_workers 1 | tee /mnt/data.coronaryct.1/ZhuYichen/LMFlow/log/finetune_with_lora/train.log 2> /mnt/data.coronaryct.1/ZhuYichen/LMFlow/log/finetune_with_lora/train.err

使用chatbot测试: image

我想知道是否是我的设置错误?还是微调有哪些需要注意的点?

我去看了data/download.sh中微调数据的格式,都没有添加'#'作为结束符,您是在哪里看到数据格式需要添加结束符#的

Shelton1013 avatar Jun 06 '23 15:06 Shelton1013

我使用一个医学问答数据集(chatdoctor)来微调robin-7b-v2,即使只训练0.01个epoch,也会导致完全失去对话能力。 数据集形式如下: { "type": "text2text", "instances": [ { "input": "###Human: Hi, I have what feels like a lump in my hip felxor, pretty much in the crease between lower abdominals and top of the quad. One on the right hip is slightly larger than the one on the left hip, and are not in symmetrical positions. When I press on either one they move around slightly, and no real pain just minor discomfort. It almost feels like a knot in a muscle. What could these be? Should I be concerned and should I seek further medical advice?###Assistant:", "output": "Studied your query in full depth of its details. Reviewed it in context of your health concerns. Based On the facts, You mostly seem to suffer from-Lymphnode enlargement in the groin / or could be from Lipoma. Any other causes of such a lump would be more evident after physical and clinical assessment of your lumps in that region. X-ray / USG / CT study would help you out in fixing the cause and nature of such a lump. Surgeon and if need be ortho-Surgeon would help you out in this work up. Hope that, This reply would help you to plan further treatment soon with your treating doctors. Best of Luck and early recovery. Welcome any further query in this regard, which would be replied in next session. N. Senior Surgical Specialist###" }, ] } 训练参数如下: CUDA_VISIBLE_DEVICES=1 deepspeed "--master_port=11000" examples/finetune.py --model_name_or_path output_models/merged --dataset_path /mnt/data.coronaryct.1/ZhuYichen/LMFlow/data/Med100k/train --output_dir /mnt/data.coronaryct.1/ZhuYichen/LMFlow/output_models/finetune_with_lora --overwrite_output_dir --num_train_epochs 0.01 --learning_rate 1e-4 --block_size 512 --per_device_train_batch_size 1 --use_lora 1 --lora_r 8 --save_aggregated_lora 0 --deepspeed configs/ds_config_zero3.json --fp16 --run_name finetune_with_lora --validation_split_percentage 0 --logging_steps 20 --do_train --ddp_timeout 72000 --save_steps 5000 --dataloader_num_workers 1 | tee /mnt/data.coronaryct.1/ZhuYichen/LMFlow/log/finetune_with_lora/train.log 2> /mnt/data.coronaryct.1/ZhuYichen/LMFlow/log/finetune_with_lora/train.err 使用chatbot测试: image 我想知道是否是我的设置错误?还是微调有哪些需要注意的点?

我去看了data/download.sh中微调数据的格式,都没有添加'#'作为结束符,您是在哪里看到数据格式需要添加结束符#的

我是一开始没有加prompt和结束符,出现了这个问题,所以猜测可能是这个原因。但是现在测试加了结束符的结果还是一样不行。请问你的测试结果怎么样?

snake-head avatar Jun 07 '23 01:06 snake-head

我使用一个医学问答数据集(chatdoctor)来微调robin-7b-v2,即使只训练0.01个epoch,也会导致完全失去对话能力。 数据集形式如下: { "type": "text2text", "instances": [ { "input": "###Human: Hi, I have what feels like a lump in my hip felxor, pretty much in the crease between lower abdominals and top of the quad. One on the right hip is slightly larger than the one on the left hip, and are not in symmetrical positions. When I press on either one they move around slightly, and no real pain just minor discomfort. It almost feels like a knot in a muscle. What could these be? Should I be concerned and should I seek further medical advice?###Assistant:", "output": "Studied your query in full depth of its details. Reviewed it in context of your health concerns. Based On the facts, You mostly seem to suffer from-Lymphnode enlargement in the groin / or could be from Lipoma. Any other causes of such a lump would be more evident after physical and clinical assessment of your lumps in that region. X-ray / USG / CT study would help you out in fixing the cause and nature of such a lump. Surgeon and if need be ortho-Surgeon would help you out in this work up. Hope that, This reply would help you to plan further treatment soon with your treating doctors. Best of Luck and early recovery. Welcome any further query in this regard, which would be replied in next session. N. Senior Surgical Specialist###" }, ] } 训练参数如下: CUDA_VISIBLE_DEVICES=1 deepspeed "--master_port=11000" examples/finetune.py --model_name_or_path output_models/merged --dataset_path /mnt/data.coronaryct.1/ZhuYichen/LMFlow/data/Med100k/train --output_dir /mnt/data.coronaryct.1/ZhuYichen/LMFlow/output_models/finetune_with_lora --overwrite_output_dir --num_train_epochs 0.01 --learning_rate 1e-4 --block_size 512 --per_device_train_batch_size 1 --use_lora 1 --lora_r 8 --save_aggregated_lora 0 --deepspeed configs/ds_config_zero3.json --fp16 --run_name finetune_with_lora --validation_split_percentage 0 --logging_steps 20 --do_train --ddp_timeout 72000 --save_steps 5000 --dataloader_num_workers 1 | tee /mnt/data.coronaryct.1/ZhuYichen/LMFlow/log/finetune_with_lora/train.log 2> /mnt/data.coronaryct.1/ZhuYichen/LMFlow/log/finetune_with_lora/train.err 使用chatbot测试: image 我想知道是否是我的设置错误?还是微调有哪些需要注意的点?

我去看了data/download.sh中微调数据的格式,都没有添加'#'作为结束符,您是在哪里看到数据格式需要添加结束符#的

我是一开始没有加prompt和结束符,出现了这个问题,所以猜测可能是这个原因。但是现在测试加了结束符的结果还是一样不行。请问你的测试结果怎么样?

我有在issue中看到你说的需要加#的,我也按照他的方式在所有的微调语料中input后面加了###,然后结尾也加上###,end_string用#,也是和你一样,还是出现这个问题。我看标准的微调流程使用finetune.sh,其中也没有涉及这个语料中添加#,官方的data/download.sh的所有数据集我都下载了,也是都没有#在数据中

Shelton1013 avatar Jun 07 '23 01:06 Shelton1013

我使用一个医学问答数据集(chatdoctor)来微调robin-7b-v2,即使只训练0.01个epoch,也会导致完全失去对话能力。 数据集形式如下: { "type": "text2text", "instances": [ { "input": "###Human: Hi, I have what feels like a lump in my hip felxor, pretty much in the crease between lower abdominals and top of the quad. One on the right hip is slightly larger than the one on the left hip, and are not in symmetrical positions. When I press on either one they move around slightly, and no real pain just minor discomfort. It almost feels like a knot in a muscle. What could these be? Should I be concerned and should I seek further medical advice?###Assistant:", "output": "Studied your query in full depth of its details. Reviewed it in context of your health concerns. Based On the facts, You mostly seem to suffer from-Lymphnode enlargement in the groin / or could be from Lipoma. Any other causes of such a lump would be more evident after physical and clinical assessment of your lumps in that region. X-ray / USG / CT study would help you out in fixing the cause and nature of such a lump. Surgeon and if need be ortho-Surgeon would help you out in this work up. Hope that, This reply would help you to plan further treatment soon with your treating doctors. Best of Luck and early recovery. Welcome any further query in this regard, which would be replied in next session. N. Senior Surgical Specialist###" }, ] } 训练参数如下: CUDA_VISIBLE_DEVICES=1 deepspeed "--master_port=11000" examples/finetune.py --model_name_or_path output_models/merged --dataset_path /mnt/data.coronaryct.1/ZhuYichen/LMFlow/data/Med100k/train --output_dir /mnt/data.coronaryct.1/ZhuYichen/LMFlow/output_models/finetune_with_lora --overwrite_output_dir --num_train_epochs 0.01 --learning_rate 1e-4 --block_size 512 --per_device_train_batch_size 1 --use_lora 1 --lora_r 8 --save_aggregated_lora 0 --deepspeed configs/ds_config_zero3.json --fp16 --run_name finetune_with_lora --validation_split_percentage 0 --logging_steps 20 --do_train --ddp_timeout 72000 --save_steps 5000 --dataloader_num_workers 1 | tee /mnt/data.coronaryct.1/ZhuYichen/LMFlow/log/finetune_with_lora/train.log 2> /mnt/data.coronaryct.1/ZhuYichen/LMFlow/log/finetune_with_lora/train.err 使用chatbot测试: image 我想知道是否是我的设置错误?还是微调有哪些需要注意的点?

我去看了data/download.sh中微调数据的格式,都没有添加'#'作为结束符,您是在哪里看到数据格式需要添加结束符#的

我是一开始没有加prompt和结束符,出现了这个问题,所以猜测可能是这个原因。但是现在测试加了结束符的结果还是一样不行。请问你的测试结果怎么样?

我有在issue中看到你说的需要加#的,我也按照他的方式在所有的微调语料中input后面加了###,然后结尾也加上###,end_string用#,也是和你一样,还是出现这个问题。我看标准的微调流程使用finetune.sh,其中也没有涉及这个语料中添加#,官方的data/download.sh的所有数据集我都下载了,也是都没有#在数据中

是的,下载的数据集确实没有这些。我是因为看到官方提供的代码里面有add_prompt.py和add_end_mark.py,所以这样尝试了一下。不过目前测试的是加了没加都不行。

snake-head avatar Jun 07 '23 01:06 snake-head

我使用一个医学问答数据集(chatdoctor)来微调robin-7b-v2,即使只训练0.01个epoch,也会导致完全失去对话能力。 数据集形式如下: { "type": "text2text", "instances": [ { "input": "###Human: Hi, I have what feels like a lump in my hip felxor, pretty much in the crease between lower abdominals and top of the quad. One on the right hip is slightly larger than the one on the left hip, and are not in symmetrical positions. When I press on either one they move around slightly, and no real pain just minor discomfort. It almost feels like a knot in a muscle. What could these be? Should I be concerned and should I seek further medical advice?###Assistant:", "output": "Studied your query in full depth of its details. Reviewed it in context of your health concerns. Based On the facts, You mostly seem to suffer from-Lymphnode enlargement in the groin / or could be from Lipoma. Any other causes of such a lump would be more evident after physical and clinical assessment of your lumps in that region. X-ray / USG / CT study would help you out in fixing the cause and nature of such a lump. Surgeon and if need be ortho-Surgeon would help you out in this work up. Hope that, This reply would help you to plan further treatment soon with your treating doctors. Best of Luck and early recovery. Welcome any further query in this regard, which would be replied in next session. N. Senior Surgical Specialist###" }, ] } 训练参数如下: CUDA_VISIBLE_DEVICES=1 deepspeed "--master_port=11000" examples/finetune.py --model_name_or_path output_models/merged --dataset_path /mnt/data.coronaryct.1/ZhuYichen/LMFlow/data/Med100k/train --output_dir /mnt/data.coronaryct.1/ZhuYichen/LMFlow/output_models/finetune_with_lora --overwrite_output_dir --num_train_epochs 0.01 --learning_rate 1e-4 --block_size 512 --per_device_train_batch_size 1 --use_lora 1 --lora_r 8 --save_aggregated_lora 0 --deepspeed configs/ds_config_zero3.json --fp16 --run_name finetune_with_lora --validation_split_percentage 0 --logging_steps 20 --do_train --ddp_timeout 72000 --save_steps 5000 --dataloader_num_workers 1 | tee /mnt/data.coronaryct.1/ZhuYichen/LMFlow/log/finetune_with_lora/train.log 2> /mnt/data.coronaryct.1/ZhuYichen/LMFlow/log/finetune_with_lora/train.err 使用chatbot测试: image 我想知道是否是我的设置错误?还是微调有哪些需要注意的点?

我去看了data/download.sh中微调数据的格式,都没有添加'#'作为结束符,您是在哪里看到数据格式需要添加结束符#的

我是一开始没有加prompt和结束符,出现了这个问题,所以猜测可能是这个原因。但是现在测试加了结束符的结果还是一样不行。请问你的测试结果怎么样?

我有在issue中看到你说的需要加#的,我也按照他的方式在所有的微调语料中input后面加了###,然后结尾也加上###,end_string用#,也是和你一样,还是出现这个问题。我看标准的微调流程使用finetune.sh,其中也没有涉及这个语料中添加#,官方的data/download.sh的所有数据集我都下载了,也是都没有#在数据中

是的,下载的数据集确实没有这些。我是因为看到官方提供的代码里面有add_prompt.py和add_end_mark.py,所以这样尝试了一下。不过目前测试的是加了没加都不行。

我也重新尝试过了,也还是不行,并且微调后的模型只会重复我的提问,甚至没有学到认识知识。我用的是lora,基模型是llama7b,微调后我也是将llama7b模型和lora merge了,我看您的图片上对话框显示是 output_models/merged/ + finetune_with_lora,我再像是否我的操作哪里出现问题了,可以问一下您这边测试的shell指令吗 image 下面是我的chatbot.py显示,我是只加载了merged后的模型,我有点困惑,已经merged了为什么还要加上finetune_lora 1686658713942

Shelton1013 avatar Jun 13 '23 12:06 Shelton1013

大佬我想问问你的cuda和cudaa都是什么版本的

ShiXiangXiang123 avatar Jun 19 '23 06:06 ShiXiangXiang123

我使用一个医学问答数据集(chatdoctor)来微调robin-7b-v2,即使只训练0.01个epoch,也会导致完全失去对话能力。 数据集形式如下: { "type": "text2text", "instances": [ { "input": "###Human: Hi, I have what feels like a lump in my hip felxor, pretty much in the crease between lower abdominals and top of the quad. One on the right hip is slightly larger than the one on the left hip, and are not in symmetrical positions. When I press on either one they move around slightly, and no real pain just minor discomfort. It almost feels like a knot in a muscle. What could these be? Should I be concerned and should I seek further medical advice?###Assistant:", "output": "Studied your query in full depth of its details. Reviewed it in context of your health concerns. Based On the facts, You mostly seem to suffer from-Lymphnode enlargement in the groin / or could be from Lipoma. Any other causes of such a lump would be more evident after physical and clinical assessment of your lumps in that region. X-ray / USG / CT study would help you out in fixing the cause and nature of such a lump. Surgeon and if need be ortho-Surgeon would help you out in this work up. Hope that, This reply would help you to plan further treatment soon with your treating doctors. Best of Luck and early recovery. Welcome any further query in this regard, which would be replied in next session. N. Senior Surgical Specialist###" }, ] } 训练参数如下: CUDA_VISIBLE_DEVICES=1 deepspeed "--master_port=11000" examples/finetune.py --model_name_or_path output_models/merged --dataset_path /mnt/data.coronaryct.1/ZhuYichen/LMFlow/data/Med100k/train --output_dir /mnt/data.coronaryct.1/ZhuYichen/LMFlow/output_models/finetune_with_lora --overwrite_output_dir --num_train_epochs 0.01 --learning_rate 1e-4 --block_size 512 --per_device_train_batch_size 1 --use_lora 1 --lora_r 8 --save_aggregated_lora 0 --deepspeed configs/ds_config_zero3.json --fp16 --run_name finetune_with_lora --validation_split_percentage 0 --logging_steps 20 --do_train --ddp_timeout 72000 --save_steps 5000 --dataloader_num_workers 1 | tee /mnt/data.coronaryct.1/ZhuYichen/LMFlow/log/finetune_with_lora/train.log 2> /mnt/data.coronaryct.1/ZhuYichen/LMFlow/log/finetune_with_lora/train.err 使用chatbot测试: image 我想知道是否是我的设置错误?还是微调有哪些需要注意的点?

我去看了data/download.sh中微调数据的格式,都没有添加'#'作为结束符,您是在哪里看到数据格式需要添加结束符#的

我是一开始没有加prompt和结束符,出现了这个问题,所以猜测可能是这个原因。但是现在测试加了结束符的结果还是一样不行。请问你的测试结果怎么样?

我有在issue中看到你说的需要加#的,我也按照他的方式在所有的微调语料中input后面加了###,然后结尾也加上###,end_string用#,也是和你一样,还是出现这个问题。我看标准的微调流程使用finetune.sh,其中也没有涉及这个语料中添加#,官方的data/download.sh的所有数据集我都下载了,也是都没有#在数据中

是的,下载的数据集确实没有这些。我是因为看到官方提供的代码里面有add_prompt.py和add_end_mark.py,所以这样尝试了一下。不过目前测试的是加了没加都不行。

我也重新尝试过了,也还是不行,并且微调后的模型只会重复我的提问,甚至没有学到认识知识。我用的是lora,基模型是llama7b,微调后我也是将llama7b模型和lora merge了,我看您的图片上对话框显示是 output_models/merged/ + finetune_with_lora,我再像是否我的操作哪里出现问题了,可以问一下您这边测试的shell指令吗 image 下面是我的chatbot.py显示,我是只加载了merged后的模型,我有点困惑,已经merged了为什么还要加上finetune_lora 1686658713942

我这里merged的模型指的是llama-7b和robin-v2-delta合并的模型,不是我微调后的模型,所以加了lora。

snake-head avatar Jun 19 '23 06:06 snake-head

大佬我想问问你的cuda和cudaa都是什么版本的

image

snake-head avatar Jun 19 '23 06:06 snake-head

This issue has been marked as stale because it has not had recent activity. If you think this still needs to be addressed please feel free to reopen this issue. Thanks

shizhediao avatar Jul 09 '23 14:07 shizhediao