class_docstr: Base Class for implementing AdaptiveModel with frameworks like PyTorch and ONNX.
class_docstr_tok: ["Base","Class","for","implementing","AdaptiveModel","with","frameworks","like","PyTorch","and","ONNX","."]
code: def _get_prediction_head_files(cls, load_dir, strict=True):
      load_dir = Path(load_dir)
      files = os.listdir(load_dir)
      model_files = [
          load_dir / f
          for f in files
          if ".bin" in f and "prediction_head" in f
      ]
      config_files = [
          load_dir / f
          for f in files
          if "config.json" in f and "prediction_head" in f
      ]
      # sort them to get correct order in case of multiple prediction heads
      model_files.sort()
      config_files.sort()
  
      if strict:
          error_str = (
              f"There is a mismatch in number of model files ({len(model_files)}) and config files ({len(config_files)})."
              "This might be because the Language Model Prediction Head "
              "does not currently support saving and loading"
          )
          assert len(model_files) == len(config_files), error_str
      logger.info(
          f"Found files for loading {len(model_files)} prediction heads"
      )
  
      return model_files, config_files
  
imports: import copy
  import json
  import logging
  import os
  from pathlib import Path
  import multiprocessing
  import numpy
  import torch
  from torch import nn
  from transformers import AutoConfig
  from transformers.convert_graph_to_onnx import convert, quantize
  from farm.data_handler.processor import Processor
  from farm.modeling.language_model import LanguageModel
  from farm.modeling.prediction_head import PredictionHead, pick_single_fn
  from farm.utils import MLFlowLogger, stack
  import farm.conversion.transformers
label_desc: Use image node_id 7 for calling the BaseAdaptiveModel obj's underlying member method code with example usage: obj._get_prediction_head_files(cls, load_dir, strict) and returns: model_files,  config_files