class_docstr: ## BERT Embeddings
  
  For a given chunk of text $N$ this class generates BERT embeddings $        ext{B\small{ERT}}(N)$.
  $   ext{B\small{ERT}}(N)$ is the average of BERT embeddings of all the tokens in $N$.
code: def __init__(self, device: torch.device):
      self.device = device
  
      # Load the BERT tokenizer from [HuggingFace](https://huggingface.co/bert-base-uncased)
      with monit.section("Load BERT tokenizer"):
          self.tokenizer = BertTokenizer.from_pretrained(
              "bert-base-uncased",
              cache_dir=str(
                  lab.get_data_path() / "cache" / "bert-tokenizer"
              ),
          )
  
      # Load the BERT model from [HuggingFace](https://huggingface.co/bert-base-uncased)
      with monit.section("Load BERT model"):
          self.model = BertModel.from_pretrained(
              "bert-base-uncased",
              cache_dir=str(
                  lab.get_data_path() / "cache" / "bert-model"
              ),
          )
  
          # Move the model to `device`
          self.model.to(device)
  
file_path: annotated_deep_learning_paper_implementations/labml_nn/transformers/retro/bert_embeddings.py
imports: from typing import List
  import torch
  from transformers import BertTokenizer, BertModel
  from labml import lab, monit
label_desc: Use image node_id 1 to create a new BERTChunkEmbeddings object  with example: obj = BERTChunkEmbeddings(device)