LLama factory接入wandb面板

三尺非寒  论坛元老 | 2025-2-20 05:45:52 | 来自手机 | 显示全部楼层 | 阅读模式
打印 上一主题 下一主题

主题 1009|帖子 1009|积分 3027


   https://github.com/hiyouga/LLaMA-Factory/blob/main/README_zh.md
  step1:先自己在wandb注册一个账号,拿到key

详见:WandB 简明教程【Weights & Bias】
step2:开始设置

阐明!!我是在代码行里运行有问题,所以直接演示网页端

  • webui起来后,举行设置,wandb是在这里

  • 然后预览下令 会出现一个report_to: all就对了,然后直接运行
  1. llamafactory-cli train \
  2.     --stage sft \
  3.     --do_train True \
  4.     --model_name_or_path {模型路径} \
  5.     --preprocessing_num_workers 16 \
  6.     --finetuning_type lora \
  7.     --template llama3 \
  8.     --flash_attn auto \
  9.     --dataset_dir data \
  10.     --dataset {数据集路径} \
  11.     --cutoff_len 1024 \
  12.     --learning_rate 5e-05 \
  13.     --num_train_epochs 3.0 \
  14.     --max_samples 100000 \
  15.     --per_device_train_batch_size 2 \
  16.     --gradient_accumulation_steps 8 \
  17.     --lr_scheduler_type cosine \
  18.     --max_grad_norm 1.0 \
  19.     --logging_steps 5 \
  20.     --save_steps 100 \
  21.     --warmup_steps 0 \
  22.     --optim adamw_torch \
  23.     --packing False \
  24.     --report_to all \
  25.     --output_dir {输出文件路径} \
  26.     --bf16 True \
  27.     --plot_loss True \
  28.     --ddp_timeout 180000000 \
  29.     --include_num_input_tokens_seen True \
  30.     --lora_rank 8 \
  31.     --lora_alpha 16 \
  32.     --lora_dropout 0 \
  33.     --lora_target all
复制代码

  • 运行到最后让你选择w&b使用模式,选2,回车
  1. wandb: Using wandb-core as the SDK backend.  Please refer to https://wandb.me/wandb-core for more information.
  2. wandb: (1) Create a W&B account
  3. wandb: (2) Use an existing W&B account
  4. wandb: (3) Don't visualize my results
  5. wandb: Enter your choice: 2
复制代码

  • 输入你在官网拿的的key即可
  1. wandb: You chose 'Use an existing W&B account'
  2. wandb: Logging into wandb.ai. (Learn how to deploy a W&B server locally: https://wandb.me/wandb-server)
  3. wandb: You can find your API key in your browser here: https://wandb.ai/authorize
  4. wandb: Paste an API key from your profile and hit enter, or press ctrl+c to quit:
复制代码

  • 最后点

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

x
回复

使用道具 举报

0 个回复

倒序浏览

快速回复

您需要登录后才可以回帖 登录 or 立即注册

本版积分规则

三尺非寒

论坛元老
这个人很懒什么都没写!
快速回复 返回顶部 返回列表