code: def test_oom_on_invoke():
      # 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": 8,
          "initial_workers": 12,
      }
      response = test_utils.register_model_with_params(params)
  
      input_text = os.path.join(
          REPO_ROOT,
          "examples",
          "Huggingface_Transformers",
          "Seq_classification_artifacts",
          "sample_text_captum_input.txt",
      )
  
      # Make 8 curl requests in parallel with &
      # Send multiple requests to make sure to hit OOM
      for i in range(10):
          response = os.popen(
              f"curl http://127.0.0.1:8080/models/BERTSeqClassification/invoke -T {input_text} && "
              f"curl http://127.0.0.1:8080/models/BERTSeqClassification/invoke -T {input_text} && "
              f"curl http://127.0.0.1:8080/models/BERTSeqClassification/invoke -T {input_text} && "
              f"curl http://127.0.0.1:8080/models/BERTSeqClassification/invoke -T {input_text} && "
              f"curl http://127.0.0.1:8080/models/BERTSeqClassification/invoke -T {input_text} && "
              f"curl http://127.0.0.1:8080/models/BERTSeqClassification/invoke -T {input_text} && "
              f"curl http://127.0.0.1:8080/models/BERTSeqClassification/invoke -T {input_text} && "
              f"curl http://127.0.0.1:8080/models/BERTSeqClassification/invoke -T {input_text} "
          )
          response = response.read()
  
      # If OOM is hit, we expect code 507 to be present in the response string
      lines = response.split("\n")
      output = ""
      for line in lines:
          if "code" in line:
              line = line.strip()
              output = line
              break
      assert output == '"code": 507,', "OOM Error expected"
  
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 3 for calling a global function with example usage: test_oom_on_invoke() without return types