Skip to content

Find local model directory

We need a generic method on BaseWorker named find_model_directory

It supports 2 modes: ponos & development. Here is the logic:

  • if env variable PONOS_TASK is set, we are running in ponos, and can assume a static path of /data/current. Simply check the folder exists, and return it (as a Pathlib.Path instance)
  • otherwise, we are running locally in developer mode. The developer may specify the path in:
    • the configuration parsed in configure_for_developers as model_dir
    • the new optional CLI parameter --model-dir
    • in both cases, check the folder exists before returning it (as a Pathlib.Path instance)