AutoTrain 文件

AutoTrain 配置

您正在檢視的是需要從原始碼安裝。如果您想透過 pip 常規安裝,請檢視最新的穩定版本 (v0.8.24)。
Hugging Face's logo
加入 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` 訓練器,在 `argilla/distilabel-capybara-dpo-7k-binarized` 資料集上微調 `meta-llama/Meta-Llama-3-8B-Instruct` 模型,訓練 3 個 epoch,批處理大小為 2,學習率為 `3e-5`。有關可用引數的更多資訊,請參閱 *資料格式和引數* 部分。

如果您不想將模型推送到 Hub,可以在配置檔案中將 `push_to_hub` 設定為 `false`。如果不將模型推送到 Hub,則不需要使用者名稱和令牌。注意:如果您嘗試訪問受限的模型或資料集,可能仍然需要它們。

< > 在 GitHub 上更新

© . This site is unofficial and not affiliated with Hugging Face, Inc.