code: def test_raises_missing_files(self, tmpdir, model_configs):
      tmpdir.mkdir("dummy_folder")
      dir_path = dir_path = os.path.join(tmpdir, "dummy_folder")
  
      model = MAF(
          model_configs,
      )
  
      rnd_key = list(model.state_dict().keys())[0]
      model.state_dict()[rnd_key][0] = 0
  
      model.save(dir_path=dir_path)
  
      os.remove(os.path.join(dir_path, "model.pt"))
  
      # check raises model.pt is missing
      with pytest.raises(FileNotFoundError):
          model_rec = AutoModel.load_from_folder(dir_path)
  
      torch.save({"wrong_key": 0.0}, os.path.join(dir_path, "model.pt"))
      # check raises wrong key in model.pt
      with pytest.raises(KeyError):
          model_rec = AutoModel.load_from_folder(dir_path)
  
      os.remove(os.path.join(dir_path, "model_config.json"))
  
      # check raises model_config.json is missing
      with pytest.raises(FileNotFoundError):
          model_rec = AutoModel.load_from_folder(dir_path)
  
imports: import os
  from copy import deepcopy
  import numpy
  import pytest
  import torch
  from pythae.models import AutoModel
  from pythae.models.base.base_utils import ModelOutput
  from pythae.models.normalizing_flows import MAF, MAFConfig, NFModel
  from pythae.pipelines import TrainingPipeline
  from pythae.trainers import BaseTrainer, BaseTrainerConfig
label_desc: Use image node_id 3 for calling the Test_Model_Saving obj's underlying member method code with example usage: obj.test_raises_missing_files(tmpdir, model_configs) without return types