class_docstr: A class providing methods for saving and loading prediction head modules from the file system.
  
  Model classes supporting configurable head modules via config files should provide a prediction head dict at
  `model.heads` and a method `add_prediction_head(head_name, config)`.
class_docstr_tok: ["A","class","providing","methods","for","saving","and","loading","prediction","head","modules","from","the","file","system",".","Model","classes","supporting","configurable","head","modules","via","config","files","should","provide","a","prediction","head","dict","at","`","model.heads","`","and","a","method","`","add_prediction_head","(","head_name",",","config",")","`","."]
code: def __init__(
      self, model, error_on_missing=True, convert_to_flex_head=False
  ):
      super().__init__(model, HEAD_WEIGHTS_NAME, HEAD_CONFIG_NAME)
      self.error_on_missing = error_on_missing
      self.convert_to_flex_head = convert_to_flex_head
  
imports: import json
  import logging
  from abc import ABC, abstractmethod
  from os import mkdir
  from os.path import exists, isdir, isfile, join
  from typing import Callable, Mapping, Sequence, Tuple
  import torch
  from .configuration import AdapterConfig, build_full_config
  from .head_utils import STATIC_TO_FLEX_HEAD_MAP, get_head_config_and_rename_list
  from .utils import ACTIVATION_RENAME, ADAPTERFUSION_CONFIG_NAME, ADAPTERFUSION_WEIGHTS_NAME, CONFIG_NAME, HEAD_CONFIG_NAME, HEAD_WEIGHTS_NAME, WEIGHTS_NAME, AdapterType, resolve_adapter_path
label_desc: Use image node_id 1 to create a new PredictionHeadLoader object from inherited base classes: WeightsLoader with example: obj = PredictionHeadLoader(model, error_on_missing, convert_to_flex_head)