code: def get_runnable(
      bento_model: bentoml.Model,
  ) -> t.Type[bentoml.Runnable]:
      """
      Private API: use :obj:`~bentoml.Model.to_runnable` instead.
      """
      logger.warning(
          "Runners created from FastAIRunnable will not be optimized for performance. If performance is critical to your usecase, please access the PyTorch model directly via 'learn.model' and use 'bentoml.pytorch.get_runnable()' instead."
      )
  
      class FastAIRunnable(bentoml.Runnable):
          # fastai only supports GPU during training, not for inference.
          SUPPORTED_RESOURCES = ("cpu",)
          SUPPORTS_CPU_MULTI_THREADING = True
  
          def __init__(self):
              super().__init__()
  
              if torch.cuda.is_available():
                  logger.debug(
                      "CUDA is available, but BentoML does not support running fastai models on GPU."
                  )
              self.learner = load_model(bento_model)
              self.learner.model.train(False)  # type: ignore (bad pytorch type) # to turn off dropout and batchnorm
              self._no_grad_context = contextlib.ExitStack()
              if hasattr(torch, "inference_mode"):  # pytorch>=1.9
                  self._no_grad_context.enter_context(
                      torch.inference_mode()
                  )
              else:
                  self._no_grad_context.enter_context(torch.no_grad())
  
              self.predict_fns: dict[str, t.Callable[..., t.Any]] = {}
              for method_name in bento_model.info.signatures:
                  try:
                      self.predict_fns[method_name] = getattr(
                          self.learner, method_name
                      )
                  except AttributeError:
                      raise InvalidArgument(
                          f"No method with name {method_name} found for Learner of type {self.learner.__class__}"
                      )
  
          def __del__(self):
              if hasattr(self, "_no_grad_context"):
                  self._no_grad_context.close()
  
      def add_runnable_method(
          method_name: str, options: ModelSignature
      ):
          def _run(
              self: FastAIRunnable,
              input_data: ext.NpNDArray
              | torch.Tensor
              | ext.PdSeries
              | ext.PdDataFrame,
          ) -> torch.Tensor:
              return self.predict_fns[method_name](input_data)
  
          FastAIRunnable.add_method(
              _run,
              name=method_name,
              batchable=options.batchable,
              batch_dim=options.batch_dim,
              input_spec=options.input_spec,
              output_spec=options.output_spec,
          )
  
      for method_name, options in bento_model.info.signatures.items():
          add_runnable_method(method_name, options)
  
      return FastAIRunnable
  
file_path: BentoML/src/bentoml/_internal/frameworks/fastai.py
imports: from __future__ import annotations
  import contextlib
  import logging
  import typing
  from types import ModuleType
  from typing import TYPE_CHECKING
  import bentoml
  from ...exceptions import BentoMLException
  from ...exceptions import InvalidArgument
  from ...exceptions import MissingDependencyException
  from ...exceptions import NotFound
  from ..models.model import ModelContext
  from ..utils.pkg import get_pkg_version
  from .common.pytorch import PyTorchTensorContainer
label_desc: Use image node_id 4 for calling a global function with example usage: get_runnable(bento_model) and returns: FastAIRunnable, self