code: def huggingface_embedding(self, text, model_path, use_fast=True):
      tokenizer = AutoTokenizer.from_pretrained(
          model_path, use_fast=use_fast
      )
      model = TFAutoModel.from_pretrained(model_path)
      tokens = tokenizer.encode(self.text)
      input_ids = tf.constant(tokens)[None, :]  # Batch size 1
      kwargs = {
          "inputs_embeds": None,
          "training": False,
      }
      if model.config.is_encoder_decoder:
          outputs = model.encoder(input_ids, **kwargs)
      else:
          outputs = model(
              input_ids, **kwargs
          )  # outputs is tuple where first element is sequence features
      last_hidden_states = outputs[0]
      return last_hidden_states.numpy()
  
imports: import os
  import json
  import unittest
  import numpy
  import pytest
  import tensorflow
  import joblib
  from transformers import AutoTokenizer, TFAutoModel, BertTokenizer
  from finetune import SequenceLabeler, DocumentLabeler
  from finetune.base_models import LayoutLM
  from finetune.base_models.huggingface.models import HFBert, HFElectraGen, HFElectraDiscrim, HFXLMRoberta, HFT5, HFAlbert, HFDebertaV3Base
  from finetune.target_models.seq2seq import HFS2S
  from sklearn.model_selection import train_test_split
  from finetune.encoding.sequence_encoder import finetune_to_indico_sequence
label_desc: Use image node_id 3 for calling the TestHuggingFace obj's underlying member method code with example usage: obj.huggingface_embedding(text, model_path, use_fast) and returns: last_hidden_states