code: def main(argv: Sequence[str]) -> Optional[dev_server.LitServerType]:
      if len(argv) > 1:
          raise app.UsageError("Too many command-line arguments.")
  
      models = {}
      model_loaders: lit_app.ModelLoadersMap = {}
  
      # glue demo model loaders.
      model_loaders["sst2"] = (
          glue_models.SST2Model,
          glue_models.GlueModelConfig.init_spec(),
      )
      model_loaders["stsb"] = (
          glue_models.STSBModel,
          glue_models.GlueModelConfig.init_spec(),
      )
      model_loaders["mnli"] = (
          glue_models.MNLIModel,
          glue_models.GlueModelConfig.init_spec(),
      )
  
      # penguin demo model loaders.
      model_loaders["penguin"] = (
          penguin_model.PenguinModel,
          penguin_model.PenguinModel.init_spec(),
      )
  
      # t5 demo model loaders.
      model_loaders["T5 summarization"] = (
          t5.T5Summarization,
          t5.T5Summarization.init_spec(),
      )
      model_loaders["T5 translation"] = (
          t5.T5Translation,
          t5.T5Translation.init_spec(),
      )
  
      # lm demo model loaders.
      model_loaders["bert"] = (
          pretrained_lms.BertMLM,
          pretrained_lms.BertMLM.init_spec(),
      )
      model_loaders["gpt2"] = (
          pretrained_lms.GPT2LanguageModel,
          pretrained_lms.GPT2LanguageModel.init_spec(),
      )
  
      # image model loaders.
      model_loaders["image"] = (
          mobilenet.MobileNet,
          mobilenet.MobileNet.init_spec(),
      )
  
      datasets = {}
      dataset_loaders: lit_app.DatasetLoadersMap = {}
  
      # glue demo dataset loaders.
      dataset_loaders["sst2"] = (
          glue.SST2Data,
          glue.SST2Data.init_spec(),
      )
      dataset_loaders["stsb"] = (
          glue.STSBData,
          glue.STSBData.init_spec(),
      )
      dataset_loaders["mnli"] = (
          glue.MNLIData,
          glue.MNLIData.init_spec(),
      )
  
      # penguin demo dataset loaders.
      dataset_loaders["penguin"] = (
          penguin_data.PenguinDataset,
          penguin_data.PenguinDataset.init_spec(),
      )
  
      # t5 demo dataset loaders.
      dataset_loaders["CNN DailyMail (t5)"] = (
          summarization.CNNDMData,
          summarization.CNNDMData.init_spec(),
      )
      dataset_loaders["WMT 14 (t5)"] = (
          mt.WMT14Data,
          mt.WMT14Data.init_spec(),
      )
  
      # lm demo dataset loaders.
      dataset_loaders["sst (lm)"] = (
          glue.SST2DataForLM,
          glue.SST2DataForLM.init_spec(),
      )
      dataset_loaders["imdb (lm)"] = (
          classification.IMDBData,
          classification.IMDBData.init_spec(),
      )
      dataset_loaders["plain text sentences (lm)"] = (
          lm.PlaintextSents,
          lm.PlaintextSents.init_spec(),
      )
      dataset_loaders["bwb (lm)"] = (
          lm.BillionWordBenchmark,
          lm.BillionWordBenchmark.init_spec(),
      )
  
      # image demo dataset loaders.
      dataset_loaders["image"] = (
          imagenette.ImagenetteDataset,
          imagenette.ImagenetteDataset.init_spec(),
      )
  
      # Start the LIT server. See server_flags.py for server options.
      lit_demo = dev_server.Server(
          models,
          datasets,
          model_loaders=model_loaders,
          dataset_loaders=dataset_loaders,
          **server_flags.get_flags(),
      )
      return lit_demo.serve()
  
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 app
  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.datasets import imagenette
  from lit_nlp.examples.datasets import lm
  from lit_nlp.examples.datasets import mt
  from lit_nlp.examples.datasets import penguin_data
  from lit_nlp.examples.datasets import summarization
  from lit_nlp.examples.models import glue_models
  from lit_nlp.examples.models import mobilenet
  from lit_nlp.examples.models import penguin_model
  from lit_nlp.examples.models import pretrained_lms
  from lit_nlp.examples.models import t5
label_desc: Use image node_id 2 for calling a global function with example usage: main(argv) and returns: lit_demo