code: def _set_max_sequence_length(
      config: "ModelConfig",
  ) -> None:  # noqa: F821
      """Ensures that `max_sequence_length` is never less than `sequence_length`."""
  
      types_with_sequence_length = [SEQUENCE, TEXT]
      for input_feature in config.input_features:
          if input_feature.type in types_with_sequence_length:
              sequence_length = (
                  input_feature.preprocessing.sequence_length
              )
              max_sequence_length = (
                  input_feature.preprocessing.max_sequence_length
              )
              if (
                  sequence_length is not None
                  and sequence_length > max_sequence_length
              ):
                  warnings.warn(
                      "if `sequence_length` is not None, `max_sequence_length` must be greater than or equal "
                      "to `sequence_length`. Setting `max_sequence_length` to `sequence_length`."
                  )
                  input_feature.preprocessing.max_sequence_length = (
                      sequence_length
                  )
  
imports: import copy
  import logging
  import sys
  import warnings
  from typing import Any, Dict, List, Mapping, Set, TYPE_CHECKING
  from marshmallow import ValidationError
  from transformers import AutoConfig
  from ludwig.api_annotations import DeveloperAPI
  from ludwig.constants import CATEGORY, COMBINED, DECODER, DEFAULTS, ENCODER, GRID_SEARCH, INPUT_FEATURES, LOSS, MODEL_ECD, MODEL_LLM, OUTPUT_FEATURES, PARAMETERS, PREPROCESSING, SEQUENCE, SPACE, TEXT, TYPE
  from ludwig.features.feature_utils import compute_feature_hash
  from ludwig.schema.features.utils import output_config_registry
  from ludwig.schema.hyperopt.scheduler import BaseHyperbandSchedulerConfig
  from ludwig.schema.llms.generation import LLMGenerationConfig
  from ludwig.schema.trainer import ECDTrainerConfig
  from ludwig.types import HyperoptConfigDict, ModelConfigDict
  from ludwig.utils.data_utils import get_sanitized_feature_name
  from ludwig.utils.llm_utils import get_context_len
label_desc: Use image node_id 10 for calling a global function with example usage: _set_max_sequence_length(config) without return types