> For the complete documentation index, see [llms.txt](https://docs.datasaur.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.datasaur.ai/build-model/datasaur-dinamic/hugging-face.md).

# Datasaur Dinamic with Hugging Face

## Introduction

**Datasaur Dinamic** with [Hugging Face Auto Train](https://huggingface.co/autotrain) helps you train and deploy models directly from labeled data in Datasaur. You can also use the trained model with ML-assisted labeling to generate predictions for unlabeled data.

This feature is available for both row labeling and span labeling projects.

## Quick start guide

Here's a step-by-step guide to achieving optimal results with our **Datasaur Dinamic** using [Hugging Face Auto Train](https://huggingface.co/autotrain) provider:

1. Create a custom project using labeled or unlabeled data.
2. If the dataset is unlabeled, start by labeling part of the data first. For example, if the dataset has 20 rows, you can label 10–15 rows and [automate the rest later](#automate-the-rest-of-the-data-with-ml-assisted).
3. Enable the **Datasaur Dinamic** extension from the **Manage extensions** dialog.

   <figure><img src="/files/dAvEScInkdopj7MXhpkr" alt=""><figcaption><p>Datasaur Dinamic with Hugging Face</p></figcaption></figure>

### Prepare Hugging Face credentials

Before training the model, prepare the following [credentials](https://huggingface.co/settings/profile):

* Your username or organization name in Hugging Face.
* An API access token.

When creating the API token, make sure all required permissions are enabled. To use the trained model with ML-assisted labeling, enable **Inference Endpoints**.

<figure><img src="/files/CQxJp26vxygLVpolGF9C" alt=""><figcaption><p>Permission options in Hugging Face API Token</p></figcaption></figure>

{% hint style="info" %}
**Inference Endpoints** are currently available only for paid Hugging Face accounts and require a [valid payment method](https://huggingface.co/docs/inference-endpoints/en/guides/access).
{% endhint %}

### Train the model

1. Open the Datasaur Dinamic extension.
2. Enter your Hugging Face username or organization name and API token.
3. For row labeling projects, select the input columns used for training and the target question.
4. Enable the **Deploy dedicated inference endpoint** option.
5. Click **Train** to start training the model.

After training starts, wait for the model to finish deploying. You can also monitor the model and dataset from your Hugging Face profile.

Once deployment is complete, the extension displays the model URL in the **Model name** field.

<figure><img src="/files/SO38jGk1ZWZmFuQvdKKc" alt=""><figcaption><p>Trained model name shown in Datasaur</p></figcaption></figure>

## Label remaining data with ML-assisted labeling

After the model is deployed, you can use the model in the **ML-assisted labeling** extension for labeling with the Hugging Face provider.

1. Copy the model name in **Model name** field from the **Datasaur Dinamic** extension.
2. Enable the **ML-assisted labeling** extension and select [Hugging Face](/assisted-labeling/ml-assisted-labeling/ml-assisted-using-huggingface.md) as your provider.
3. Paste the model name to the **Model name** field in the **ML-assisted labeling** extension.

   <figure><img src="/files/QhGN4d2NhDovVmemxHqM" alt=""><figcaption></figcaption></figure>
4. Enter your API token and set the confidence score.
5. Click **Predict labels** to generate labels for the remaining data.

This workflow helps reduce the amount of manual labeling needed for large datasets.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.datasaur.ai/build-model/datasaur-dinamic/hugging-face.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
