code: def test_oom_on_model_load():
      """
      Validates that TorchServe returns reponse code 507 if there is OOM on model loading.
      """
  
      # Create model store directory
      pathlib.Path(test_utils.MODEL_STORE).mkdir(
          parents=True, exist_ok=True
      )
  
      # Start TorchServe
      test_utils.start_torchserve(no_config_snapshots=True)
  
      # Register model
      params = {
          "model_name": "BERTSeqClassification",
          "url": "https://torchserve.pytorch.org/mar_files/BERTSeqClassification.mar",
          "batch_size": 1,
          "initial_workers": 16,
      }
      response = test_utils.register_model_with_params(params)
  
      assert response.status_code == 507, "OOM Error expected"
  
      test_utils.stop_torchserve()
  
file_path: serve/test/pytest/test_sm_mme_requirements.py
imports: import os
  import pathlib
  import pytest
  import requests
  import test_utils
  import torch
label_desc: Use image node_id 2 for calling a global function with example usage: test_oom_on_model_load() without return types