code: def main(_):
      models = {}
      loaded_datasets = {}
  
      for model_string in _MODELS.value:
          # Only split on the first two ':', because path may be a URL
          # containing 'https://'
          name, path = model_string.split(":", 1)
          logging.info("Loading model '%s' from '%s'", name, path)
          # Normally path is a directory; if it's an archive file, download and
          # extract to the transformers cache.
          if path.endswith(".tar.gz"):
              path = file_cache.cached_path(
                  path, extract_compressed_file=True
              )
          # Load the model from disk.
          models[name] = is_eval_models.ISEvalModel(
              name, path, output_attention=False
          )
  
      logging.info("Loading data for SST-2 task.")
      for data_key, url in DATASETS.items():
          path = file_cache.cached_path(url)
          loaded_datasets[
              data_key
          ] = datasets.SingleInputClassificationFromTSV(path, data_key)
  
      # Truncate datasets if --max_examples is set.
      for name in loaded_datasets:
          logging.info(
              "Dataset: '%s' with %d examples",
              name,
              len(loaded_datasets[name]),
          )
          loaded_datasets[name] = (
              loaded_datasets[name]
              .shuffle()
              .slice[: _MAX_EXAMPLES.value]
          )
          logging.info(
              "  truncated to %d examples", len(loaded_datasets[name])
          )
  
      # Start the LIT server. See server_flags.py for server options.
      lit_demo = dev_server.Server(
          models,
          loaded_datasets,
          layouts=CUSTOM_LAYOUTS,
          onboard_end_doc=_DOC_STRING,
          **server_flags.get_flags(),
      )
      return lit_demo.serve()
  
file_path: lit/lit_nlp/examples/is_eval/is_eval_demo.py
imports: import sys
  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.api import layout
  from lit_nlp.examples.is_eval import datasets
  from lit_nlp.examples.is_eval import models
  from lit_nlp.lib import file_cache
label_desc: Use image node_id 2 for calling a global function with example usage: main(_) and returns: lit_demo