code: def main(argv: Sequence[str]) -> Optional[dev_server.LitServerType]:
      if len(argv) > 1:
          raise app.UsageError("Too many command-line arguments.")
  
      ##
      # Load models, according to the --models flag.
      models = {}
      for model_name_or_path in _MODELS.value:
          # Ignore path prefix, if using /path/to/<model_name> to load from a
          # specific directory rather than the default shortcut.
          model_name = os.path.basename(model_name_or_path)
          models[model_name] = tydi.TyDiModel(
              model_name=model_name_or_path
          )
  
      max_examples: int = _MAX_EXAMPLES.value
      dataset_defs: tuple[tuple[str, str]] = (
          ("TyDiQA-Multilingual", "validation"),
          ("TyDiQA-English", "validation-en"),
          ("TyDiQA-Finnish", "validation-fi"),
          ("TyDiQA-Arabic", "validation-ar"),
          ("TyDiQA-Bengali", "validation-bn"),
          ("TyDiQA-Indonesian", "validation-id"),
          ("TyDiQA-Korean", "validation-ko"),
          ("TyDiQA-Russian", "validation-ru"),
          ("TyDiQA-Swahili", "validation-sw"),
          ("TyDiQA-Telugu", "validation-te"),
      )
      datasets = {
          name: question_answering.TyDiQA(
              split=split, max_examples=max_examples
          )
          for name, split in dataset_defs
      }
  
      generators = {"word_replacer": word_replacer.WordReplacer()}
  
      lit_demo = dev_server.Server(
          models,
          datasets,
          generators=generators,
          **server_flags.get_flags(),
      )
      return lit_demo.serve()
  
file_path: lit/lit_nlp/examples/tydi_demo.py
imports: from collections.abc import Sequence
  import os
  import sys
  from typing import Optional
  from absl import app
  from absl import flags
  from lit_nlp import dev_server
  from lit_nlp import server_flags
  from lit_nlp.components import word_replacer
  from lit_nlp.examples.datasets import question_answering
  from lit_nlp.examples.models import tydi
label_desc: Use image node_id 2 for calling a global function with example usage: main(argv) and returns: lit_demo