code: def _get_default_max_tokens(sample_input, sample_output) -> tuple:
      """Placeholder docstring"""
      inputs = sample_input.get("inputs")
      generated_text = sample_output[0].get("generated_text")
  
      input_tokens_from_chars = _tokens_from_chars(inputs)
      input_tokens_from_words = _tokens_from_words(inputs)
      max_input_tokens = max(
          input_tokens_from_chars, input_tokens_from_words
      )
  
      output_tokens_from_chars = _tokens_from_chars(generated_text)
      output_tokens_from_words = _tokens_from_words(generated_text)
      max_output_tokens = max(
          output_tokens_from_chars, output_tokens_from_words
      )
  
      max_total_tokens = _set_tokens_to_tokens_threshold(
          max_input_tokens + max_output_tokens
      )
  
      max_new_tokens = sample_input.get("parameters").get(
          "max_new_tokens"
      )
      if not max_new_tokens:
          max_new_tokens = _set_tokens_to_tokens_threshold(
              max_output_tokens
          )
  
      return (max_total_tokens, max_new_tokens)
  
file_path: sagemaker-python-sdk/src/sagemaker/serve/model_server/djl_serving/utils.py
imports: from __future__ import absolute_import
  from urllib.error import HTTPError
  import math
  import logging
  from sagemaker.serve.utils.types import _DjlEngine
  from sagemaker.djl_inference import defaults
  from sagemaker.djl_inference.model import _get_model_config_properties_from_hf
  from sagemaker.serve.utils.local_hardware import _get_available_gpus
  from sagemaker.serve.builder.schema_builder import SchemaBuilder
label_desc: Use image node_id 8 for calling a global function with example usage: _get_default_max_tokens(sample_input, sample_output) and returns: max_total_tokens,  max_new_tokens