
AutoTrain lets you fine-tune and deploy machine-learning models without writing code, using an interface to choose your data, model and training hardware. The application is part of the Hugging Face ecosystem and offers a simpler project workflow alongside a more technical Advanced option. You can also use it through Google Colab. Learn which tasks it supports, how to prepare a project and what to check before paying for training.
Choose a Task and Prepare Your Data
TL;DR Key Takeaways :
- AutoTrain provides a no-code route for creating, fine-tuning and deploying models.
- Supported work spans text, images and tabular data across multiple languages.
- AutoTrain says training can cost as little as $10 per job; more model candidates increase the cost.
- Beginners can choose automatic model selection, while Advanced and Colab offer alternative workflows.
- Training uploads are deleted after completion, and transfers are encrypted.
AutoTrain can create and fine-tune models for image, text and tabular data. Its supported tasks include:
- Text tasks include classification, token classification, question answering, translation, summarization and regression.
- Image classification is supported for models trained on images.
- Tabular tasks include both classification and regression.
The application supports languages including English, German, French and Spanish, as well as Finnish, Swedish, Hindi, Dutch, Arabic and Chinese. Training files can be uploaded in CSV, TSV or JSON format. Your training data is private to your account, transfers are encrypted, and uploaded training files are deleted after training is complete.
Check the Cost Before Training
AutoTrain says training can cost as little as $10 per job and that users receive the computational cost and a payment link. Selecting more model candidates increases the training cost, so the amount depends on the choices made for a job. The training screen displays the cost, and you can add payment if the job exceeds the free plan.
The user-friendly interface lets you select a model, hardware and hyperparameters without writing code. If you are unfamiliar with model selection, the automatic option is recommended for the new-project workflow. AutoTrain Advanced offers more room to adjust a model, but it is more technical and requires more work.
Create and Train a Project
The new-project workflow is recommended if you do not have a computer science or AI background. Alternatively, the Auto Train advanced feature lets you create a Space and make further adjustments while a model is being fine-tuned and trained. The steps below start with the simpler workflow, followed by the alternative Advanced and Colab routes.
- On the Hugging Face AutoTrain page, click Create New Project, name your project and choose a task. The example uses text classification.
- Choose a model manually or use automatic model selection if you are unsure which model to use. Click Create Project, then upload a dataset or search for one on the Hugging Face Hub. The example selects Open Platypus, its default configuration and the training split.
- Click Next and map the columns: the text column contains the text to classify, while the target column contains the labels to assign. Choose a split type: Training trains the model, Validation evaluates its performance, and Auto uses both split types.
- Alternatively, start from a Hugging Face dataset card by clicking Train with AutoTrain, choosing the default configuration and creating the project.
- After selecting or uploading the data, open Training and choose the number of model candidates. Check the displayed cost, add payment if the job exceeds the free plan, and start training.
- Use the Metrics tab to track progress. When training is complete, download the output model from the Training tab for use in an application such as a chatbot.
- For the Advanced route instead, open its option on the AutoTrain page, choose a license and a Space SDK such as Docker, Gradio or Streamlit, and select AutoTrain. Enter your Hugging Face token and task variables, choose a public or private Space, and name it.
- Select the hardware and create the Space. You can then make further adjustments while the model is fine-tuned and trained.
- For the Colab route instead, install the project’s dependencies and upload the training dataset as train.csv. Create a folder called Data and put the file in it.
- Format the dataset with a text column that presents the system message and specifies the inputs and outputs for fine-tuning. Check the model card when preparing the data, since many models specify their fine-tuning prompt and text-column format there.
- Enter a project name and the model name or model card for the model you want to fine-tune, such as Llama 2 7 billion. Adjust the parameters, including the learning rate, and update the corresponding model card name, project name and parameters in the command.
- To publish the resulting model to Hugging Face, enter the repository ID and Hugging Face token and change the publish setting to true. Change the Colab runtime to an appropriate hardware accelerator, save a copy of the notebook to Drive and click Play to run training and produce the fine-tuned model output.
We think the new-project workflow is the best place to begin if you are unfamiliar with model selection: automatic selection and access to datasets reduce the choices you need to make at the outset. The cost screen still deserves a careful check before training, especially when selecting multiple candidates. Advanced and Colab give you other routes when you need to adjust more of the setup, but they ask more of you than the simpler interface.
For a straightforward way to fine-tune a model, AutoTrain brings datasets and models together in the Hugging Face interface. Choose the route that fits your experience, and check the model card when preparing data for the Colab workflow.
- How GPT-LLM-Trainer Fine-Tunes a Model From a Task Description
- How to fine tune ChatGPT 3.5 Turbo to save tokens and money
- OpenAI selects Scale to fine-tune GPT-3.5
- How to Download and Fine-Tune Llama 2 on French Quotes
Source: YouTube
Disclosure: Some of our articles include affiliate links. If you buy something through one of these links, Geeky Gadgets may earn an affiliate commission. Learn about our Disclosure Policy.