code: def mean_pooling(self, model_output, attention_mask):
      token_embeddings = model_output[
          0
      ]  # First element of model_output contains all token embeddings
      input_mask_expanded = (
          attention_mask.unsqueeze(-1)
          .expand(token_embeddings.size())
          .float()
      )
      return torch.sum(
          token_embeddings * input_mask_expanded, 1
      ) / torch.clamp(input_mask_expanded.sum(1), min=1e-9)
  
imports: import argparse
  import logging
  import math
  import os
  import random
  from pathlib import Path
  import datasets
  import evaluate
  import torch
  import transformers
  from accelerate import Accelerator
  from accelerate.logging import get_logger
  from accelerate.utils import set_seed
  from datasets import DatasetDict, load_dataset
  from huggingface_hub import Repository, create_repo
  from torch import nn
  from torch.utils.data import DataLoader
  from tqdm import tqdm
  from transformers import AutoModel, AutoTokenizer, SchedulerType, default_data_collator, get_scheduler
  from transformers.utils import get_full_repo_name
  from peft import LoraConfig, TaskType, get_peft_model
label_desc: Use image node_id 3 for calling the AutoModelForSentenceEmbedding obj's underlying member method code with example usage: obj.mean_pooling(model_output, attention_mask) and returns: unknown