code: def predict_fn(data, model_and_tokenizer):
      # destruct model and tokenizer
      model, tokenizer = model_and_tokenizer
  
      # Tokenize sentences
      sentences = data.pop("inputs", data)
      encoded_input = tokenizer(
          sentences, padding=True, truncation=True, return_tensors="pt"
      )
  
      # Compute token embeddings
      with torch.no_grad():
          model_output = model(**encoded_input)
  
      # Perform pooling
      sentence_embeddings = mean_pooling(
          model_output, encoded_input["attention_mask"]
      )
  
      # Normalize embeddings
      sentence_embeddings = F.normalize(sentence_embeddings, p=2, dim=1)
  
      # return dictonary, which will be json serializable
      return {"vectors": sentence_embeddings}
  
imports: from transformers import AutoTokenizer, AutoModel
  import torch
  import torch.nn.functional
label_desc: Use image node_id 3 for calling a global function with example usage: predict_fn(data, model_and_tokenizer) and returns: dict