AutoTrain Advanced: การฝึกอบรมและการปรับใช้โมเดลการเรียนรู้ของเครื่องที่ล้ำสมัยได้เร็วและง่ายขึ้น AutoTrain Advanced เป็นโซลูชันที่ไม่ต้องเขียนโค้ดซึ่งช่วยให้คุณฝึกโมเดล Machine Learning ได้ด้วยการคลิกเพียงไม่กี่ครั้ง โปรดทราบว่าคุณต้องอัปโหลดข้อมูลในรูปแบบที่ถูกต้องเพื่อสร้างโครงการ หากต้องการความช่วยเหลือเกี่ยวกับรูปแบบข้อมูลและราคาที่เหมาะสม โปรดดูเอกสารประกอบ
หมายเหตุ: AutoTrain ฟรี! คุณจะจ่ายเฉพาะทรัพยากรที่คุณใช้ในกรณีที่คุณตัดสินใจเรียกใช้ AutoTrain บน Hugging Face Spaces เมื่อทำงานในพื้นที่ คุณจะจ่ายเฉพาะทรัพยากรที่คุณใช้บนโครงสร้างพื้นฐานของคุณเองเท่านั้น
งาน | สถานะ | สมุดบันทึกหลาม | ตัวอย่างการกำหนดค่า |
---|---|---|---|
การปรับแต่ง LLM SFT | llm_sft_finetune.yaml | ||
การปรับแต่ง LLM ORPO | llm_orpo_finetune.yaml | ||
การปรับแต่ง LLM อ.ส.ค | llm_dpo_finetune.yaml | ||
การปรับแต่งรางวัล LLM | llm_reward_finetune.yaml | ||
LLM การปรับแต่งทั่วไป/ค่าเริ่มต้น | llm_generic_finetune.yaml | ||
การจำแนกข้อความ | text_classification.yaml | ||
การถดถอยข้อความ | text_regression.yaml | ||
การจำแนกประเภทโทเค็น | เร็วๆ นี้ | token_classification.yaml | |
Seq2Seq | เร็วๆ นี้ | seq2seq.yaml | |
การตอบคำถามแบบแยกส่วน | เร็วๆ นี้ | extractive_qa.yaml | |
การจำแนกประเภทภาพ | เร็วๆ นี้ | image_classification.yaml | |
การให้คะแนนรูปภาพ/การถดถอย | เร็วๆ นี้ | image_regression.yaml | |
วีแอลเอ็ม | - | เร็วๆ นี้ | vlm.yaml |
ปรับใช้ AutoTrain บน Hugging Face Spaces:
เรียกใช้ AutoTrain UI บน Colab ผ่าน ngrok:
คุณสามารถติดตั้งแพ็คเกจหลาม AutoTrain-Advanced ผ่าน PIP โปรดทราบว่าคุณจะต้องใช้ python >= 3.10 เพื่อให้ AutoTrain Advanced ทำงานได้อย่างถูกต้อง
pip install autotrain-advanced
โปรดตรวจสอบให้แน่ใจว่าคุณได้ติดตั้ง git lfs แล้ว ตรวจสอบคำแนะนำที่นี่: https://github.com/git-lfs/git-lfs/wiki/Installation
คุณต้องติดตั้ง torch, torchaudio และ torchvision ด้วย
วิธีที่ดีที่สุดในการรันระบบออโต้เทรนคืออยู่ในสภาพแวดล้อมแบบคอนดา คุณสามารถสร้างสภาพแวดล้อม conda ใหม่ได้ด้วยคำสั่งต่อไปนี้:
conda create -n autotrain python=3.10
conda activate autotrain
pip install autotrain-advanced
conda install pytorch torchvision torchaudio pytorch-cuda=12.1 -c pytorch -c nvidia
conda install -c "nvidia/label/cuda-12.1.0" cuda-nvcc
เมื่อเสร็จแล้วคุณสามารถเริ่มแอปพลิเคชันโดยใช้:
autotrain app --port 8080 --host 127.0.0.1
หากคุณไม่ชอบ UI คุณสามารถใช้ AutoTrain Configs เพื่อฝึกโดยใช้บรรทัดคำสั่งหรือเพียงแค่ AutoTrain CLI
หากต้องการใช้ไฟล์กำหนดค่าสำหรับการฝึก คุณสามารถใช้คำสั่งต่อไปนี้:
autotrain --config <path_to_config_file>
คุณสามารถค้นหาไฟล์กำหนดค่าตัวอย่างได้ในไดเร็กทอรี configs
ของที่เก็บนี้
ตัวอย่างไฟล์กำหนดค่าสำหรับการปรับแต่ง SmolLM2:
task : llm-sft
base_model : HuggingFaceTB/SmolLM2-1.7B-Instruct
project_name : autotrain-smollm2-finetune
log : tensorboard
backend : local
data :
path : HuggingFaceH4/no_robots
train_split : train
valid_split : null
chat_template : tokenizer
column_mapping :
text_column : messages
params :
block_size : 2048
model_max_length : 4096
epochs : 2
batch_size : 1
lr : 1e-5
peft : true
quantization : int4
target_modules : all-linear
padding : right
optimizer : paged_adamw_8bit
scheduler : linear
gradient_accumulation : 8
mixed_precision : bf16
merge_adapter : true
hub :
username : ${HF_USERNAME}
token : ${HF_TOKEN}
push_to_hub : true
หากต้องการปรับแต่งโมเดลโดยใช้ไฟล์กำหนดค่าด้านบน คุณสามารถใช้คำสั่งต่อไปนี้:
$ export HF_USERNAME= < your_hugging_face_username >
$ export HF_TOKEN= < your_hugging_face_write_token >
$ autotrain --config < path_to_config_file >
เอกสารสามารถดูได้ที่ https://hf.co/docs/autotrain/
@inproceedings{thakur-2024-autotrain,
title = "{A}uto{T}rain: No-code training for state-of-the-art models",
author = "Thakur, Abhishek",
booktitle = "Proceedings of the 2024 Conference on Empirical Methods in Natural Language Processing: System Demonstrations",
month = nov,
year = "2024",
address = "Miami, Florida, USA",
publisher = "Association for Computational Linguistics",
url = "https://aclanthology.org/2024.emnlp-demo.44",
pages = "419--423",
abstract = "With the advancements in open-source models, training(or finetuning) models on custom datasets has become a crucial part of developing solutions which are tailored to specific industrial or open-source applications. Yet, there is no single tool which simplifies the process of training across different types of modalities or tasks.We introduce AutoTrain(aka AutoTrain Advanced){---}an open-source, no code tool/library which can be used to train (or finetune) models for different kinds of tasks such as: large language model (LLM) finetuning, text classification/regression, token classification, sequence-to-sequence task, finetuning of sentence transformers, visual language model (VLM) finetuning, image classification/regression and even classification and regression tasks on tabular data. AutoTrain Advanced is an open-source library providing best practices for training models on custom datasets. The library is available at https://github.com/huggingface/autotrain-advanced. AutoTrain can be used in fully local mode or on cloud machines and works with tens of thousands of models shared on Hugging Face Hub and their variations.",
}