class_docstr: Transformers base model (for working with pytorch-transformers models)
class_docstr_tok: ["Transformers","base","model","(","for","working","with","pytorch-transformers","models",")"]
docstr: Create a TranformerBase deom from given path
  
  Args:
      model_path (str): path to model
      model_type (str): model type
  
  Returns:
      TransformerBase: model
docstr_tok: ["Create","a","TranformerBase","deom","from","given","path","Args",":","model_path","(","str",")",":","path","to","model","model_type","(","str",")",":","model","type","Returns",":","TransformerBase",":","model"]
code: def load_model(
      cls, model_path: str, model_type: str, *args, **kwargs
  ):
      """
      Create a TranformerBase deom from given path
  
      Args:
          model_path (str): path to model
          model_type (str): model type
  
      Returns:
          TransformerBase: model
      """
      # Load a trained model and vocabulary from given path
      if not os.path.exists(model_path):
          raise FileNotFoundError
      with io.open(model_path + os.sep + "labels.txt") as fp:
          labels = [line.strip() for line in fp.readlines()]
      return cls(
          model_type=model_type,
          model_name_or_path=model_path,
          labels=labels,
          *args,
          **kwargs,
      )
  
imports: import io
  import logging
  import os
  from typing import List, Union
  import torch
  from torch.utils.data import DataLoader
  from tqdm import tqdm, trange
  from transformers import AdamW, BertConfig, BertTokenizer, RobertaConfig, RobertaTokenizer, XLMConfig, XLMTokenizer, XLNetConfig, XLNetTokenizer, get_linear_schedule_with_warmup
  from nlp_architect.models import TrainableModel
  from nlp_architect.models.transformers.quantized_bert import QuantizedBertConfig
label_desc: Use image node_id 11 for calling the TransformerBase obj's underlying member method code with example usage: obj.load_model(cls, model_path, model_type) and returns: cls