class_docstr: Integration with the Hugging Face Inference API.
code: def create(
      self,
      target: str,
      df: Optional[pd.DataFrame] = None,
      args: Optional[Dict] = None,
  ) -> None:
      if "using" not in args:
          raise InsufficientParametersException(
              "Hugging Face Inference engine requires a USING clause! Refer to its documentation for more details."
          )
  
      # check api key
      self._get_huggingface_api_key(args)
  
      args = args["using"]
      args["target"] = target
  
      if "options" not in args:
          args["options"] = {}
  
      if "parameters" not in args:
          args["parameters"] = {}
  
      if args["model_name"] is not None:
          # config.json
          config = {}
          try:
              config_path = hf_hub_download(
                  args["model_name"], "config.json"
              )
              config = json.load(open(config_path))
          except Exception:
              pass
  
          if "max_length" in args:
              args["options"]["max_length"] = args["max_length"]
          elif "max_position_embeddings" in config:
              args["options"]["max_length"] = config[
                  "max_position_embeddings"
              ]
          elif "max_length" in config:
              args["options"]["max_length"] = config["max_length"]
  
          labels_default = config.get("id2label", {})
          labels_map = {}
          if "labels" in args:
              for num, value in labels_default.items():
                  if num.isdigit():
                      num = int(num)
                      labels_map[value] = args["labels"][num]
          args["labels_map"] = labels_map
          if "task_specific_params" in config:
              args["task_specific_params"] = config[
                  "task_specific_params"
              ]
  
      # for summarization
      if "min_output_length" in args:
          args["options"]["min_output_length"] = args[
              "min_output_length"
          ]
  
      if "max_output_length" in args:
          args["options"]["max_output_length"] = args[
              "max_output_length"
          ]
  
      self.model_storage.json_set("args", args)
  
file_path: mindsdb/mindsdb/integrations/handlers/huggingface_api_handler/huggingface_api_handler.py
imports: import json
  import os
  from typing import Optional, Dict
  import pandas
  from huggingface_hub import HfApi
  from huggingface_hub import hf_hub_download
  from hugging_py_face import NLP, ComputerVision, AudioProcessing, get_in_df_supported_tasks
  from mindsdb.utilities.config import Config
  from mindsdb.integrations.libs.base import BaseMLEngine
  from .exceptions import UnsupportedTaskException, InsufficientParametersException
label_desc: Use image node_id 2 for calling the HuggingFaceInferenceAPIHandler obj's underlying member method code with example usage: obj.create(target, df, args) without return types