استخدم Qlora لضبط نموذج اللغة الصينية الكبيرة.
استخدم Qlora لضبط Baichuan-7b ، والرمز أكثر إيجازًا: https://github.com/taishan1994/baichuan-qlora tuning
numpy == 1.24 . 2
pandas == 2.0 . 0
nltk == 3.7
transformers == 4.30 . 0. dev0
accelerate == 0.20 . 0. dev0
deepspeed == 0.9 . 2
peft == 0.4 . 0. dev0
datasets == 2.12 . 0
evaluate == 0.2 . 2
sentencepiece == 0.1 . 97
scipy == 1.10 . 1
icetk
cpm_kernels
mpi4py == 3.1 . 4 - - output #训练保存lora权重
- - - - chatglm
- - - - alpaca
- - - - bloom
- - data
- - - - msra
- - - - - - instruct_data
- - - - - - - - train . json #指令数据
- - model_hub
- - - - BELLE - 7 B - 2 M #bloom权重
- - - - chatglm - 6 b #chatGLM权重
- - - - 7 B : #英文LLaMA原始权重
- - - - 7 B - hf : #英文权重转换为hugging face格式权重
- - - - chinese - llama - plus - lora - 7 b : #中文llama-7b的lora权重
- - - - chinese - alpaca - plus - lora - 7 b : #中文alpaca-7b的lora权重
- - - - chinese - alpaca - 7 b : #合并lora后的最终的模型
- - - - tokenizer . model : #原始llama的7B文件
- - - - convert_llama_weights_to_hf . py #llama转换为hugging face格式
- - - - merge_llama_with_chinese_lora . py #合并lora到预训练模型
- - tools
- - - - get_version . py #获取python包版本
- - - - get_used_gpus . py #循环打印使用的GPU显卡
- - chat . py # 闲聊
- - qlora . py # 4bit训练
- - process . py # 测试处理数据عنوان ChatGlm-6B التنزيل: Disk Cloud University University (Tsinghua.edu.cn)
python qlora . py - - model_name = "chatglm" - - model_name_or_path = "./model_hub/chatglm-6b" - - trust_remote_code = True - - dataset = "msra" - - source_max_len = 128 - - target_max_len = 64 - - do_train - - save_total_limit = 1 - - padding_side = "left" - - per_device_train_batch_size = 8 - - do_eval - - bits = 4 - - save_steps = 10 - - gradient_accumulation_steps = 1 - - learning_rate = 1e-5 - - output_dir = "./output/chatglm/" - - lora_r = 8 - - lora_alpha = 32يُحظر على نموذج LLAMA الذي تم إصداره رسميًا من قبل Facebook الاستخدام التجاري ، وليس للمسؤول أوزان نموذجية مفتوحة المصدر (على الرغم من وجود العديد من عناوين تنزيل الطرف الثالث على الإنترنت). من أجل اتباع الإذن المقابل ، من المستحيل حاليًا نشر أوزان النموذج الكاملة. يرجى فهم (الشيء نفسه صحيح في الخارج في الوقت الحاضر). ابحث عن عنوان التنزيل بنفسك.
python convert_llama_weights_to_hf.py --input_dir ./ --model_size 7B --output_dir ./7B-hf . إذا تم الإبلاغ عن خطأ: If this call came from a _pb2.py file, your generated code is out of date and must be regenerated with protoc >= 3.19.0 ، فيمكنك pip install --upgrade protobuf==3.20.1 ، ثم: python convert_llama_weights_to_hf.py --input_dir ./ --model_size tokenizer_only --output_dir ./7B-hf . أخيرًا يمكننا الحصول على 7B-HF.python merge_llama_with_chinese_lora.py --base_model "./7B-hf" --lora_model "./chinese-llama-plus-lora-7b,chinese-alpaca-plus-lora-7b" --output_type "huggingface" --output_dir "./chinese-alpaca-7b" . أخيرًا ، يمكننا الحصول على الصينيين-ألباكا -7 ب. python qlora . py - - model_name = "chinese_alpaca" - - model_name_or_path = "./model_hub/chinese-alpaca-7b" - - trust_remote_code = False - - dataset = "msra" - - source_max_len = 128 - - target_max_len = 64 - - do_train - - save_total_limit = 1 - - padding_side = "right" - - per_device_train_batch_size = 8 - - do_eval - - bits = 4 - - save_steps = 10 - - gradient_accumulation_steps = 1 - - learning_rate = 1e-5 - - output_dir = "./output/alpaca/" - - lora_r = 8 - - lora_alpha = 32Belle-7B-2M عنوان التنزيل: Bellegroup/Belle-7B-2M في Main (Huggingface.co)
python qlora . py - - model_name = "chinese_bloom" - - model_name_or_path = "./model_hub/BELLE-7B-2M" - - trust_remote_code = False - - dataset = "msra" - - source_max_len = 128 - - target_max_len = 64 - - do_train - - save_total_limit = 1 - - padding_side = "left" - - per_device_train_batch_size = 8 - - do_eval - - bits = 4 - - save_steps = 10 - - gradient_accumulation_steps = 1 - - learning_rate = 1e-5 - - output_dir = "./output/bloom/" - - lora_r = 8 - - lora_alpha = 32 python chat . py - - model_name "chatglm" - - base_model "./model_hub/chatglm-6b" - - tokenizer_path "./model_hub/chatglm-6b" - - lora_model "./output/chatglm/adapter_model" - - with_prompt - - interactiveكيف تدرب بياناتك الخاصة؟ تنسيق البيانات هو:
{
"data" : [
{ "instruction" : "" , "input" : "" , "output" : "" },
{ "instruction" : "" , "input" : "" , "output" : "" },
...
]
}ثم أضف مجموعة البيانات الخاصة بك في المكان الذي يتم فيه تعريف البيانات في qlora.py. أخيرًا ، حدد المعلمات ذات الصلة بنفسك عند تشغيل الأمر.
liucongg/chatglm-finetuning: استنادًا إلى نموذج chatglm-6b ، يتم تنفيذ المهام المحددة للتصحيح ، والتي تتضمن تجميد ، لور ، ص ، ص ، إلخ (github.com)
thudm/chatglm-6b: chatglm-6b: نموذج لغة حوار مفتوح ثنائي اللغة | نموذج لغة الحوار المثالي مفتوح المصدر (github.com)
Huggingface/PEFT :؟ PEFT: صقل دقيق لمكافحة المعلمة. (github.com)
YMCUI/صينية-بلاما-ألباكا: صينية لاما وألباكا نموذج اللغة الكبيرة + نشر التدريب على وحدة المعالجة المركزية/وحدة معالجة الرسومات (الصينية LLAMA & Alpaca LLMS) (github.com)
Lianjiatech/Belle: Belle: Be Engine Glody Glange Model Engine (نموذج حوار صيني مفتوح المصدر) (github.com)
Artidoro/Qlora: Qlora: Finetuning فعالة من LLMs الكمية (github.com)
أي شخص طيب القلب ، كادو ، يمكنك تجربة التأثير النهائي؟ استئجار AutoDL لا يكفي لتلبية احتياجاتهم