code: def serve(model_results_dir: str, host: str, port: int):
      """
      expose a REST endpoint in order to use the trained machine learning model
      """
      try:
          os.environ[Constants.model_results_path] = model_results_dir
          uvicorn_params = {"host": host, "port": int(port)}
          fastapi_server.run(**uvicorn_params)
  
      except Exception as ex:
          logger.exception(ex)
  
imports: import logging
  import os
  import subprocess
  from pathlib import Path
  import click
  import igel
  import pandas
  from igel import Igel, metrics_dict
  from igel.constants import Constants
  from igel.servers import fastapi_server
  from igel.utils import print_models_overview, show_model_info, tableize
label_desc: Use image node_id 8 for calling a global function with example usage: serve(model_results_dir, host, port) without return types