AutoTrain 文档
AutoTrain 配置
您正在查看 main 版本,该版本需要从源代码安装。如果您想要常规 pip 安装,请查看最新的稳定版本 (v0.8.24)。
加入 Hugging Face 社区
并获得增强的文档体验
开始使用
AutoTrain 配置
AutoTrain 配置是使用 AutoTrain 在本地使用和训练模型的方式。
一旦您安装了 AutoTrain Advanced,您可以使用以下命令,通过 AutoTrain 配置文件来训练模型
$ export HF_USERNAME=your_hugging_face_username
$ export HF_TOKEN=your_hugging_face_write_token
$ autotrain --config path/to/config.yaml
所有任务的示例配置都可以在 AutoTrain Advanced GitHub 仓库 的 configs
目录中找到。
这是一个 AutoTrain 配置文件的示例
task: llm
base_model: meta-llama/Meta-Llama-3-8B-Instruct
project_name: autotrain-llama3-8b-orpo
log: tensorboard
backend: local
data:
path: argilla/distilabel-capybara-dpo-7k-binarized
train_split: train
valid_split: null
chat_template: chatml
column_mapping:
text_column: chosen
rejected_text_column: rejected
params:
trainer: orpo
block_size: 1024
model_max_length: 2048
max_prompt_length: 512
epochs: 3
batch_size: 2
lr: 3e-5
peft: true
quantization: int4
target_modules: all-linear
padding: right
optimizer: adamw_torch
scheduler: linear
gradient_accumulation: 4
mixed_precision: bf16
hub:
username: ${HF_USERNAME}
token: ${HF_TOKEN}
push_to_hub: true
在此配置中,我们正在使用 orpo
训练器,以 2 的批次大小和 3e-5
的学习率,对 argilla/distilabel-capybara-dpo-7k-binarized
数据集上的 meta-llama/Meta-Llama-3-8B-Instruct
模型进行 3 个 epoch 的微调。有关可用参数的更多信息,请参阅数据格式和参数部分。
如果您不想将模型推送到 Hub,您可以在配置文件中将 push_to_hub
设置为 false
。如果不将模型推送到 Hub,则不需要用户名和令牌。注意:如果您尝试访问受限模型或数据集,则可能仍然需要它们。