Hugging Face: Serverless Inference action
- Updated: 2024/11/05
Hugging Face: Serverless Inference action
This topic describes using the Hugging Face: Serverless Inference action to leverage the power of Hugging Face models for various NLP tasks.
Prerequisites
Note: The examples and graphics provided on this page are for
representation purposes only and may not accurately reflect your specific instance. We do not
assume responsibility for their maintenance or
accuracy.
- You must have the Bot creator role to use the Hugging Face: Authentication action in a bot.
- Create a Hugging Face account. You can create an account here Create a Hugging Face account.
- Ensure that you have the necessary credentials to send a request and have included Hugging Face: Authentication action before calling Hugging Face: Serverless Inference action.
Procedure
More examples
The following automation showcases text to image, image to text, and text to audio generation capabilities using the Hugging Face: Serverless Inference action. Each example is explained in detail in the subsequent sections.
Text to Image
The following example demonstrates text to image generation capability using the Hugging Face: Serverless Inference action:
Note: Provide a Data File Path to which the
image gets saved to.
Image to Text
The following example demonstrates image to text generation capability using the Hugging Face: Serverless Inference action:
Note: Convert the image to a Base64 format using Base64
Conversion >> Base64 Encode action
before feeding it to the model. The model requires the image in this format to
accurately generate text.
Text to Audio
The following examples demonstrates text to audio generation capability using the Hugging Face: Serverless Inference action:
Note: Provide a Data File Path with an
extension to which the input prompt text in the Request
payload is converted to an audio format.