Cleanup external data path validation

Merged
AD
8mo ago
+283-99

Description

  • Updates the ValidateExternalData() function:
    • Resolves symlinks when validating external data path for models loaded from memory.
      • Previously only did a lexical check that did not resolve symlinks. Now, we resolve symlinks.
    • Now requires external data path to exist.
    • Replace the (base_dir, model_dir) function parameters with just model_dir. base_dir was always derived from model_dir.
    • Skip validation for WASM builds that do not have a filesystem.
    • Return Status instead of throwing exceptions when std::filesystem functions fail.
  • Updates Graph::ConvertInitializersIntoOrtValues():
    • Prevents unnecessary calls to ValidateExternalData() for external data paths that have already been validated.

Motivation and Context