class_docstr: Base Class from Normalizing flows
  
  Args:
      model_config (BaseNFConfig): The configuration setting the main parameters of the
          model.
docstr: Class method to be used to load the model from a specific folder
  
  Args:
      dir_path (str): The path where the model should have been be saved.
  
  .. note::
      This function requires the folder to contain:
  
      - | a ``model_config.json`` and a ``model.pt`` if no custom architectures were provided
docstr_tok: ["Class","method","to","be","used","to","load","the","model","from","a","specific","folder","Args",":","dir_path","(","str",")",":","The","path","where","the","model","should","have","been","be","saved",".","..","note",":",":","This","function","requires","the","folder","to","contain",":","-","|","a","``","model_config.json","``","and","a","``","model.pt","``","if","no","custom","architectures","were","provided"]
code: def load_from_folder(cls, dir_path):
      """Class method to be used to load the model from a specific folder
  
      Args:
          dir_path (str): The path where the model should have been be saved.
  
      .. note::
          This function requires the folder to contain:
  
          - | a ``model_config.json`` and a ``model.pt`` if no custom architectures were provided
      """
  
      model_config = cls._load_model_config_from_folder(dir_path)
      model_weights = cls._load_model_weights_from_folder(dir_path)
      model = cls(model_config)
      model.load_state_dict(model_weights)
  
      return model
  
imports: import os
  import sys
  from copy import deepcopy
  import numpy
  import torch
  import torch.nn
  from ....data.datasets import BaseDataset
  from ...auto_model import AutoConfig
  from ...base.base_config import EnvironmentConfig
  from ...base.base_utils import ModelOutput
  from .base_nf_config import BaseNFConfig
label_desc: Use image node_id 8 for calling the BaseNF obj's underlying member method code with example usage: obj.load_from_folder(cls, dir_path) and returns: model