当前位置: 首页 > news >正文

llama-factory微调chatglm3

一、定义

  1. 案例/多卡

二、实现

  1. 案例
    1. 下载chatglm3-6b-32k模型
    2. 配置数据集在这里插入图片描述
  2. 微调指令
CUDA_VISIBLE_DEVICES=0,1 llamafactory-cli train \--stage sft \--do_train True \--model_name_or_path /home/chatglm3-6b-32k \--finetuning_type lora \--template chatglm3 \--dataset_dir ./data \--dataset adgen_local \--cutoff_len 1024 \--learning_rate 5e-05 \--num_train_epochs 3.0 \--max_samples 1000 \--per_device_train_batch_size 2 \--gradient_accumulation_steps 8 \--lr_scheduler_type cosine \--max_grad_norm 1.0 \--logging_steps 5 \--save_steps 100 \--warmup_steps 0 \--optim adamw_torch \--output_dir saves/ChatGLM3-6B/lora/sft \--fp16 True \--lora_rank 8 \--lora_alpha 16 \--lora_dropout 0.1 \--lora_target query_key_value \--plot_loss True

在这里插入图片描述
4. 推理

CUDA_VISIBLE_DEVICES=0 llamafactory-cli chat \--model_name_or_path /home/chatglm3-6b-32k \--adapter_name_or_path ./saves/ChatGLM3-6B/lora/sft  \--template chatglm3 \--finetuning_type lora

在这里插入图片描述
5. 合并并导出

CUDA_VISIBLE_DEVICES=0 llamafactory-cli export \--model_name_or_path /home/chatglm3-6b-32k \--adapter_name_or_path ./saves/ChatGLM3-6B/lora/sft  \--template chatglm3 \--finetuning_type lora \--export_dir megred-model-chatglm3 \--export_size 2 \--export_device auto \--export_legacy_format False

在这里插入图片描述

http://www.lryc.cn/news/376555.html

相关文章:

  • 大文件上传实现
  • 为何Proteus用户争相拥抱SmartEDA?揭秘背后的强大吸引力!
  • 万界星空科技QMS质量管理介绍
  • 神经网络 torch.nn---nn.LSTM()
  • Web前端JSP软件:深度解析与探索之旅
  • 人生的乐趣,在于对真知的追求
  • IPython大揭秘:神奇技巧让你掌握无敌编程力量!
  • 逻辑卷管理器 (LVM) 简介
  • Swift开发——弱占用
  • 化工电力系统RFID无线测温技术的重要性。
  • Linux系统:线程互斥
  • 【网络协议栈】TCP/IP相关知识点收集
  • Java开发中的常用字段校验注解
  • 面试经验分享 | 24年6月某安全厂商HW面试经验
  • JSON学习
  • LabVIEW在中国航天中的应用
  • 编程思维的培养
  • Docker笔记-Debian容器内搭建ssh服务
  • 爬虫的法律风险是什么?以及合法使用爬虫技术的建议。
  • 微信小程序允许相机访问相册
  • AMEYA360 | 江苏润石最新发布12颗车规级模拟芯片
  • PHP表单设计:确保必需字段完整性的最佳实践
  • CentOS 7 安装部署Cassandra4.1.5
  • 【数据结构与算法】对称矩阵,三角矩阵 详解
  • Apache IoTDB 走进东南大学,深入分享项目发展历程与收获
  • Stable Diffusion AI绘画助力建筑设计艺术创新——城市建筑设计大模型分享
  • 没有 ADetailer,ComfyUI 画图脸崩了怎么办?
  • 防爆气象仪的工作原理
  • 深度学习入门5——为什么神经网络可以学习?
  • Integer溢出问题