docstr: Initialize the language model.
  
  Parameters
  ----------
  model_path
      `transformers` package model path.
  preloading
      Whether to preload the online version of the transformer. If ``False``, a call to `from_disk`
      method is expected.
docstr_tok: ["Initialize","the","language","model",".","Parameters","--","--","--","--","--","model_path","`","transformers","`","package","model","path",".","preloading","Whether","to","preload","the","online","version","of","the","transformer",".","If","``","False","``",",","a","call","to","`","from_disk","`","method","is","expected","."]
code: def __init__(self, model_path: str, preloading: bool = True):
      """
      Initialize the language model.
  
      Parameters
      ----------
      model_path
          `transformers` package model path.
      preloading
          Whether to preload the online version of the transformer. If ``False``, a call to `from_disk`
          method is expected.
      """
      self.model_path = model_path
  
      if preloading:
          # set model (for performance reasons the `call` method is wrapped in tf.function)
          self.model = TFAutoModelForMaskedLM.from_pretrained(
              model_path
          )
  
          self.caller = tf.function(
              self.model.call, experimental_relax_shapes=True
          )
  
          # set tokenizer
          self.tokenizer = AutoTokenizer.from_pretrained(model_path)
  
imports: import abc
  import numpy
  from pathlib import Path
  from typing import Any, Callable, List, Optional, Tuple, Union
  import tensorflow
  import transformers
  from transformers import TFAutoModelForMaskedLM, AutoTokenizer
label_desc: Use image node_id 1 to create a new LanguageModel object from inherited base classes: abc with example: obj = LanguageModel(model_path, preloading)