AutoTrain Advanced: تدريب ونشر أسرع وأسهل لنماذج التعلم الآلي الحديثة. يعد AutoTrain Advanced حلاً بدون تعليمات برمجية يسمح لك بتدريب نماذج التعلم الآلي ببضع نقرات فقط. يرجى ملاحظة أنه يجب عليك تحميل البيانات بالتنسيق الصحيح حتى يتم إنشاء المشروع. للحصول على مساعدة فيما يتعلق بتنسيق البيانات المناسب والتسعير، راجع الوثائق.
ملاحظة: AutoTrain مجاني! أنت تدفع فقط مقابل الموارد التي تستخدمها في حال قررت تشغيل AutoTrain على Hugging Face Spaces. عند التشغيل محليًا، فإنك تدفع فقط مقابل الموارد التي تستخدمها في البنية الأساسية الخاصة بك.
مهمة | حالة | مفكرة بايثون | تكوينات المثال |
---|---|---|---|
LLM SFT ضبط دقيق | ✅ | llm_sft_finetune.yaml | |
LLM ORPO ضبط دقيق | ✅ | llm_orpo_finetune.yaml | |
LLM DPO ضبط دقيق | ✅ | 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 | ؟ | قريباً | vlm.yaml |
نشر AutoTrain على مساحات الوجه المعانقة:
قم بتشغيل AutoTrain UI على Colab عبر ngrok:
يمكنك تثبيت حزمة AutoTrain-Advanced python عبر 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 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
إذا لم تكن مغرمًا بواجهة المستخدم، فيمكنك استخدام 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.",
}