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

# 🤗 Hugging Face x Workbooks

[Hugging Face (HF)](https://huggingface.co/) is a open-source platform for sharing and utilizing ML models. It hosts thousands of fine-tuned machine learning and generative AI models. You can now use  Hugging Face models in an AI Workbook - along with the other models we support!

Here are a few Hugging Face workbooks to get started:&#x20;

* [Hugging Face Onboarding Workbook](https://lastmileai.dev/workbooks/clkip6h670005qrebbjjjquiq)
* [Build your Hugging Face Space with Gradio](https://lastmileai.dev/workbooks/clnti3gkm007fqwion50dig2d)

## How To Use Hugging Face in AI Workbooks

### Create a Hugging Face Model Cell&#x20;

* Click '+' to Add a cell
* Select 'Hugging Face Models'&#x20;
* Select 'Task' (categorization of what the models do e.g. Text to Image)&#x20;

<figure><img src="/files/8v8CuEouVDtoFri5VkzI" alt=""><figcaption></figcaption></figure>

This will create an HF cell with the **default model** for the selected Task. For 'Text to Image', the default model is **stablilityai/stable-diffusion-2-1**. See below:&#x20;

<figure><img src="/files/QVI3vXARdUTTFmQmkLw5" alt=""><figcaption></figcaption></figure>

You can now prompt the default HF model!&#x20;

### Update Cell to a Non-Default Hugging Face Model&#x20;

In order to update the model of the HF cell to a non-default model, you will need to enter your HF API token.&#x20;

To add your HF API token, click the key icon next to the model name in the cell.&#x20;

<figure><img src="/files/HvDGKtSW9r4MSeLcjoVg" alt=""><figcaption></figcaption></figure>

With your HF token added, you can update the model to **any** HF model for the selected Task which is hosted on HF Inference Endpoint!

You can check that a model will work for a cell by confirming that the Hosted inference API works in the Model Card in Hugging Face:

<figure><img src="/files/wiYBb60xAo3XODBGqd1g" alt=""><figcaption></figcaption></figure>

### Update Hugging Face Cell to another Model Cell Type&#x20;

You cannot change a Hugging Face Cell to another model cell type (e.g. ChatGPT, Stable Diffusion) via the model dropdown menu. You will need to delete the HF Cell and create a new model cell. <br>

## Not sure what Hugging Face models to use?&#x20;

Check out the [Hugging Face Models Library](https://huggingface.co/models?pipeline_tag=text-to-image) to explore models by task. Often times, model pages will include tips on prompts, examples, etc. so you can get a sense of the model.&#x20;

If you want to request a task or model to be supported, please reach out to us on [our Discord](https://discord.com/invite/xBhNKTetGx).

## Benefits of Using Hugging Face x Workbooks

We ♥️ Hugging Face. We believe that AI workbooks provide a great user experience to interact and play with Hugging Face models in a lightweight way.&#x20;

Here are a few awesome things you can with Hugging Face models in Workbooks:&#x20;

1. Try multiple Hugging Face models in a single notebook interface.
2. Organize, save, and share results from Hugging Face models.&#x20;
3. Easily switch models to compare model performance for the same task

## Feedback or Questions

We would love to hear from you! Please reach out to us on [our Discord](https://discord.com/invite/xBhNKTetGx).&#x20;
