🔨 Integrations
Hugging Face is the Github of the machine learning community, with hundreds of thousands of pre-trained models and 10,000 datasets currently available. You can freely access models and datasets shared by other industry experts or host and deploy your models on Hugging Face.
Some examples of models available in the Hugging Face library include:
In Hugging Face, over 130,000 machine-learning models are available through the public API, which you can use and test for free at https://huggingface.co/models. In addition, if you need a solution for production scenarios, you can use Hugging Face’s Inference Endpoints, which can be deployed and accessed at https://huggingface.co/docs/inference-endpoints/index.
ILLA Builder provides dozens of commonly used front-end components, allowing you to build different front-end interfaces based on your specific needs quickly. At the same time, ILLA offers a connection to Hugging Face, allowing you to quickly connect to the API, send requests, and receive returned data. By connecting the API and front-end components, you can implement the requirement that users can enter content through the front end and submit it to the API. The API returns the generated content to be displayed on the front end.
Properties | Required | Description |
---|---|---|
Name | required | Define a resource name that will be used for display in ILLA |
Token | required | The user access or API token. You can get it in https://huggingface.co/settings/tokens. |
Properties | Required | Description |
---|---|---|
Model ID | required | Search for models: https://huggingface.co/models |
Parameter type | required | The parameter type of your endpoint. For example, if your endpoint needs an text input, choose fill in “inputs” parameter with text. If your endpoint needs an JSON input, choose fill in “inputs” parameter with JSON or key-value. |
Parameter | required | Enter your parameter. Use {{ componentName.value }} to use data of components. |
Based on the expected usage scenario you described, build a front-end interface. For example, you could use input and image components if your product takes in text and outputs an image. If your product takes in text and outputs generated text, you could use input and text components.
The following image is an example of a front-end page for a product that answer questions based on context.
Click + New in the action list and select Hugging Face Inference API.
Fill in the form to connect to your Hugging Face:
Name: The name that will be displayed in ILLA
Token: Get in your Hugging Face profile settings
Confirm the model information in Hugging Face before configuring the actions:
Select a model in Hugging Face Model Page
Let’s use deepset/roberta-base-squad2 as an example. Enter the detail page > click Deploy > Click Inference API
The parameters after “inputs”
is what you should fill in ILLA.
In ILLA Builder, we should fill in the Model ID and Parameter. Taking the above model as an example, the “inputs”
is a key-value pair, so we can fill in it with key-value or JSON.
And we also support the text input and binary input which can meet all Hugging Face Inference API connections.
To pass the user’s front-end input to the API, you can use {{ to retrieve data inputted in the component. For example, input2 is the component to input the question and input1 is the component to input context, we can fill question
and context
in key, and fill {{ input.value }}
in value:
{
"question": {{input2.value}},
"context": {{input1.value}}
}
Before displaying the output data of the Action in the front-end component, we should confirm which field the output of different models is placed in. Still taking deepset/roberta-base-squad2
as an example, the results are as follows:
So we can get the answer with {{ textQuestion.data[0].answer }}
(the textQuestion
is the name of the action).