Sen descrición

jch 2261041a54 init hai 1 semana
src 20509cbb3a init hai 1 semana
.gitignore 20509cbb3a init hai 1 semana
README.md d7ba05adf7 init hai 1 semana

README.md

1. finetune性别大模型(昵称&头像)

1.1 下载随机数据

  • python src/preprocess/download_user_info.py --num 4000 --output_file data/user_info.csv

1.2 标注数据

  • 根据昵称(nick_name)和头像(avatar_url), 标注data/user_info.csv的gender[男性|女性|未知]

1.3 合并标注后的数据

  • 标注完成的数据下载到本地,并保存为csv格式
  • python src/preprocess/merge_label_data.py --files data/微信昵称&头像\ -\ 1-昌辉-完成.csv,data/微信昵称&头像\ -\ 2-张博-完成.csv,data/微信昵称&头像\ -\ 3-jh-完成.csv,data/微信昵称&头像\ -\ 4-ln-完成.csv,data/微信昵称&头像\ -\ 5-wz-完成.csv,data/微信昵称&头像\ -\ 6-dm-完成.csv --output data/user_info_label.csv

1.4 下载头像

  • python src/preprocess/download_image.py --input_file data/user_info_label.csv --output_dir image

1.5 格式化数据

  • python src/preprocess/format_user_info.py --input_file data/user_info_label.csv --image_dir image --output_file data/user_info_format.csv

1.6 生成样本数据

  • python src/preprocess/generate_qw2_5_lora_sft_data.py --input_file data/user_info_format.csv --train_file data/train_sft.csv --test_file data/test_sft.csv --test_rate 0.5