code: def embedding(
      self,
      model: str,
      input: list,
      api_key: Optional[str] = None,
      api_base: Optional[str] = None,
      logging_obj=None,
      model_response=None,
      encoding=None,
  ):
      super().embedding()
      headers = self.validate_environment(api_key, headers=None)
      # print_verbose(f"{model}, {task}")
      embed_url = ""
      if "https" in model:
          embed_url = model
      elif api_base:
          embed_url = api_base
      elif "HF_API_BASE" in os.environ:
          embed_url = os.getenv("HF_API_BASE", "")
      elif "HUGGINGFACE_API_BASE" in os.environ:
          embed_url = os.getenv("HUGGINGFACE_API_BASE", "")
      else:
          embed_url = (
              f"https://api-inference.huggingface.co/models/{model}"
          )
  
      if "sentence-transformers" in model:
          if len(input) == 0:
              raise HuggingfaceError(
                  status_code=400,
                  message="sentence transformers requires 2+ sentences",
              )
          data = {
              "inputs": {
                  "source_sentence": input[0],
                  "sentences": [
                      "That is a happy dog",
                      "That is a very happy person",
                      "Today is a sunny day",
                  ],
              }
          }
      else:
          data = {"inputs": input}  # type: ignore
  
      ## LOGGING
      logging_obj.pre_call(
          input=input,
          api_key=api_key,
          additional_args={
              "complete_input_dict": data,
              "headers": headers,
              "api_base": embed_url,
          },
      )
      ## COMPLETION CALL
      response = requests.post(
          embed_url, headers=headers, data=json.dumps(data)
      )
  
      ## LOGGING
      logging_obj.post_call(
          input=input,
          api_key=api_key,
          additional_args={"complete_input_dict": data},
          original_response=response,
      )
  
      embeddings = response.json()
  
      if "error" in embeddings:
          raise HuggingfaceError(
              status_code=500, message=embeddings["error"]
          )
  
      output_data = []
      if "similarities" in embeddings:
          for idx, embedding in embeddings["similarities"]:
              output_data.append(
                  {
                      "object": "embedding",
                      "index": idx,
                      "embedding": embedding,  # flatten list returned from hf
                  }
              )
      else:
          for idx, embedding in enumerate(embeddings):
              if isinstance(embedding, float):
                  output_data.append(
                      {
                          "object": "embedding",
                          "index": idx,
                          "embedding": embedding,  # flatten list returned from hf
                      }
                  )
              elif isinstance(embedding, list) and isinstance(
                  embedding[0], float
              ):
                  output_data.append(
                      {
                          "object": "embedding",
                          "index": idx,
                          "embedding": embedding,  # flatten list returned from hf
                      }
                  )
              else:
                  output_data.append(
                      {
                          "object": "embedding",
                          "index": idx,
                          "embedding": embedding[0][
                              0
                          ],  # flatten list returned from hf
                      }
                  )
      model_response["object"] = "list"
      model_response["data"] = output_data
      model_response["model"] = model
      input_tokens = 0
      for text in input:
          input_tokens += len(encoding.encode(text))
  
      model_response["usage"] = {
          "prompt_tokens": input_tokens,
          "total_tokens": input_tokens,
      }
      return model_response
  
imports: import os, copy, types
  import json
  from enum import Enum
  import httpx, requests
  from .base import BaseLLM
  import time
  import litellm
  from typing import Callable, Dict, List, Any
  from litellm.utils import ModelResponse, Choices, Message, CustomStreamWrapper, Usage
  from typing import Optional
  from .prompt_templates.factory import prompt_factory, custom_prompt
label_desc: Use image node_id 5 for calling the Huggingface obj's underlying member method code with example usage: obj.embedding(model, input, api_key, api_base, logging_obj, model_response, encoding) and returns: model_response