code: def test_runner_gpu_configuration(
      container_from_file: t.Callable[[str], ConfigDictType]
  ):
      GPU_INDEX = """\
  runners:
      resources:
          nvidia.com/gpu: [1, 2, 4]
      workers_per_resource: 1
  """
      bentoml_cfg = container_from_file(GPU_INDEX)
      assert bentoml_cfg["runners"]["resources"] == {
          "nvidia.com/gpu": [1, 2, 4]
      }
      assert bentoml_cfg["runners"]["workers_per_resource"] == 1
  
      GPU_INDEX_WITH_STRING = """\
  runners:
      resources:
          nvidia.com/gpu: "[1, 2, 4]"
      workers_per_resource: 2
  """
      bentoml_cfg = container_from_file(GPU_INDEX_WITH_STRING)
      # this behaviour can be confusing
      assert bentoml_cfg["runners"]["resources"] == {
          "nvidia.com/gpu": "[1, 2, 4]"
      }
      assert bentoml_cfg["runners"]["workers_per_resource"] == 2
  
file_path: BentoML/tests/unit/_internal/configuration/test_containers.py
imports: from __future__ import annotations
  import typing
  from typing import TYPE_CHECKING
  import pytest
  from bentoml.exceptions import BentoMLConfigException
label_desc: Use image node_id 4 for calling a global function with example usage: test_runner_gpu_configuration(container_from_file) without return types