code: def get_dataset_with_emb_from_model(
      dataset,
      model,
      feature_extractor,
      image_column="image",
      index_name="embeddings",
  ):
      return dataset.map(
          lambda example: {
              index_name: map_img_to_model_feature(
                  model,
                  feature_extractor,
                  [example[image_column]],
                  model.device,
              )
          }
      )
  
imports: import os
  from typing import List
  import faiss
  import numpy
  import torch
  from datasets import Dataset, load_dataset
  from PIL import Image
  from transformers import CLIPFeatureExtractor, CLIPModel, PretrainedConfig
  from diffusers import logging
label_desc: Use image node_id 5 for calling a global function with example usage: get_dataset_with_emb_from_model(dataset, model, feature_extractor, image_column, index_name) and returns: dataset