code: def _load_model(instance_path):
      model_path = os.environ.get("MODEL_PATH")
      model_class = os.environ.get("MODEL_CLASS")
      train_set_path = os.environ.get("TRAIN_SET")
  
      if model_path is None:
          raise ValueError(
              "MODEL_PATH environment variable is not set."
          )
      elif not os.path.isabs(model_path):
          model_path = os.path.join(
              os.path.dirname(instance_path), model_path
          )
  
      if model_class is None:
          raise ValueError(
              "MODEL_CLASS environment variable is not set."
          )
  
      print(f"Loading the '{model_class}' model from '{model_path}'...")
  
      global model, train_set
  
      try:
          model = _import_model_class(model_class).load(model_path)
      except:  # fallback to Recommender as our last resort
          from ..models import Recommender
  
          model = Recommender.load(model_path)
  
      train_set = None
      if train_set_path is not None:
          if not os.path.isabs(train_set_path):
              train_set_path = os.path.join(
                  os.path.dirname(instance_path), train_set_path
              )
          train_set = Dataset.load(train_set_path)
      elif os.path.exists(
          train_set_path := model.load_from + ".trainset"
      ):
          train_set = Dataset.load(train_set_path)
  
      print(
          "Model loaded"
          if train_set is None
          else """
          Model and train set loaded. Remove seen items by adding 
          remove_seen=true' query param to the recommend endpoint.
          """
      )
  
file_path: cornac/cornac/serving/app.py
imports: import os
  import sys
  import inspect
  from datetime import datetime, timezone
  from csv import writer
  from cornac.data import Dataset, Reader
  from cornac.eval_methods import BaseMethod
  from cornac.metrics import *
label_desc: Use image node_id 3 for calling a global function with example usage: _load_model(instance_path) without return types