Skip to main content

Hugging Face model

Call a Hugging Face model for any task (classify, fill in, read a picture or sound) with a JSON payload or a data file, and return its answer.

Command in the Generative AI toolkit · id ooa.genai/huggingface_inference · 7 inputs (1 required), 4 outputs

Inputs​

InputTypeRequiredDefaultWhat it is
ModelStringYesThe model's id on Hugging Face, owner/name.
PayloadStringNoThe request as JSON, as the model's task expects it, usually {"inputs": ..., "parameters": {...}}.
Data fileFileNoA picture or sound file sent as it is, for tasks that read one (at most 25 MB).
API keyCredentialNoYour Hugging Face access token (hf_...) from the vault; not needed for your own server.
Endpoint addressStringNoAddress the model id is added to; https://router.huggingface.co/hf-inference/models when empty, or your own inference server.
Output fileFileNoWhere to save the answer when the model answers with a picture or sound.
Timeout (seconds)NumberNo0Seconds to wait for the model; 180 when 0.

Outputs​

OutputTypeWhat it is
textStringThe model's answer as text (empty when it answered with a file).
jsonAnyThe answer parsed as JSON, when it is JSON.
content_typeStringThe answer's content type.
fileStringWhere a picture or sound the model made was saved (output_file).