code: def pool_and_normalize_encodings(
      input_sentences, model, tokenizer, **kwargs
  ):
      def pool(model_output, attention_mask):
          embeddings = model_output[0]
          expanded_mask = (
              attention_mask.unsqueeze(-1)
              .expand(embeddings.size())
              .float()
          )
          return torch.sum(embeddings * expanded_mask, 1) / torch.clamp(
              expanded_mask.sum(1), min=1e-9
          )
  
      encoded = tokenizer(
          input_sentences,
          padding=True,
          truncation=True,
          return_tensors="pt",
      )
      with torch.no_grad():
          model_output = model(**encoded)
  
      pooled = pool(model_output, encoded["attention_mask"])
      return torch.nn.functional.normalize(pooled, p=2, dim=1)
  
imports: import torch
  from transformers import BertModel, BertTokenizerFast, pipeline
  import mlflow
label_desc: Use image node_id 1 for calling a global function with example usage: pool_and_normalize_encodings(input_sentences, model, tokenizer) and returns: torch, unknown