class_docstr: Class for huggingface models
  
  Attributes:
      model_path: Local or huggingface.co path to the model
      name: string identifier for the model. Lowercase letters and numbers.
          No spaces/special characters except dashes.
      description: String description of the model.
      tasks: List of supported task strings
      details: Dictionary of additional details about the model
      init_model: Callable to initialise model from path
          Defaults to AutoModelForPreTraining from huggingface
      tokenizer_path (optional): Path to the tokenizer
      init_tokenizer (optional): Callable to initialise tokenizer from path
          Defaults to AutoTokenizer from huggingface.
      device (optional): Device for inference. Defaults to "cuda" if available.
code: def __init__(
      self,
      model_path,
      tokenizer_path=None,
      name: str = None,
      description: str = None,
      tasks: List[str] = None,
      details: Dict = None,
      model_class=AutoModelForPreTraining,
      tokenizer_class=AutoTokenizer,
      device=None,
  ):
      # Usually the same
      if not tokenizer_path:
          tokenizer_path = model_path
  
      # Object was made with init = False
      if hasattr(self, "initialised"):
          model_path = self.model_path
          tokenizer_path = self.tokenizer_path
          init_model = self.init_model
          init_tokenizer = self.init_tokenizer
          device = self._model_device
      else:
          init_model = model_class.from_pretrained
          init_tokenizer = tokenizer_class.from_pretrained
  
      return PathModel.__init__(
          self,
          model_path,
          name=name,
          description=description,
          tasks=tasks,
          details=details,
          tokenizer_path=tokenizer_path,
          init_model=init_model,
          init_tokenizer=init_tokenizer,
          device=device,
      )
  
imports: from typing import List, Tuple, Dict
  from transformers import AutoModelForPreTraining, AutoTokenizer, AutoModelForSequenceClassification, AdamW
  from torch.utils.data import DataLoader, Subset
  from sentence_transformers import SentenceTransformer
  from functools import partial
  import os
  import torch
  import torch.nn.functional
  import pytorch_lightning
  from pytorch_lightning.callbacks.early_stopping import EarlyStopping
  from pytorch_lightning.utilities.memory import garbage_collection_cuda
label_desc: Use image node_id 1 to create a new HFModel object from inherited base classes: PathModel with example: obj = HFModel(model_path, tokenizer_path, name, description, tasks, details, model_class, tokenizer_class, device)