code: def main(argv: Sequence[str]) -> Optional[dev_server.LitServerType]:
      if len(argv) > 1:
          raise app.UsageError("Too many command-line arguments.")
  
      # Normally path is a directory; if it's an archive file, download and
      # extract to the transformers cache.
      model_path = _MODEL_PATH.value
      if model_path.endswith(".tar.gz"):
          model_path = file_cache.cached_path(
              model_path, extract_compressed_file=True
          )
  
      models = {
          "nli": glue_models.MNLIModel(
              model_path, inference_batch_size=16
          )
      }
      datasets = {
          "xnli": classification.XNLIData(
              "validation", _LANGUAGES.value
          ),
          "mnli_dev": glue.MNLIData("validation_matched"),
          "mnli_dev_mm": glue.MNLIData("validation_mismatched"),
      }
  
      # Truncate datasets if --max_examples is set.
      for name in datasets:
          logging.info(
              "Dataset: '%s' with %d examples",
              name,
              len(datasets[name]),
          )
          datasets[name] = datasets[name].slice[: _MAX_EXAMPLES.value]
          logging.info(
              "  truncated to %d examples", len(datasets[name])
          )
  
      # Start the LIT server. See server_flags.py for server options.
      lit_demo = dev_server.Server(
          models, datasets, **server_flags.get_flags()
      )
      return lit_demo.serve()
  
file_path: lit/lit_nlp/examples/xnli_demo.py
imports: from collections.abc import Sequence
  import sys
  from typing import Optional
  from absl import app
  from absl import flags
  from absl import logging
  from lit_nlp import dev_server
  from lit_nlp import server_flags
  from lit_nlp.examples.datasets import classification
  from lit_nlp.examples.datasets import glue
  from lit_nlp.examples.models import glue_models
  from lit_nlp.lib import file_cache
label_desc: Use image node_id 2 for calling a global function with example usage: main(argv) and returns: lit_demo