Skip to content

Commit 124050b

Browse files
authored
Downgrade ONNX runtime to 1.20.1 for MacOS 12 compatibility (#249)
* Downgrade ONNX runtime to 1.20.1 for MacOS 12 compatibility Later versions than this removed support for MacOS 12, but as we support the same MacOS versions as OBS which supports MacOS 12, we want to keep supporting it too. Also bump the minimum required version when using a system installed ONNX runtime, for consistency. Fixes: #248 * Fix CMake formatting * Remove ONNX error codes added in later versions of the lib
1 parent 28b5b79 commit 124050b

3 files changed

Lines changed: 8 additions & 12 deletions

File tree

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ endif()
8888

8989
if(USE_SYSTEM_ONNXRUNTIME)
9090
if(OS_LINUX)
91-
find_package(Onnxruntime 1.16.3 REQUIRED)
91+
find_package(Onnxruntime 1.20.1 REQUIRED)
9292
set(Onnxruntime_INCLUDE_PATH
9393
${Onnxruntime_INCLUDE_DIR} ${Onnxruntime_INCLUDE_DIR}/onnxruntime
9494
${Onnxruntime_INCLUDE_DIR}/onnxruntime/core/session ${Onnxruntime_INCLUDE_DIR}/onnxruntime/core/providers/cpu)

cmake/FetchOnnxruntime.cmake

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ set(CUSTOM_ONNXRUNTIME_HASH
88
""
99
CACHE STRING "Hash of a downloaded ONNX Runtime tarball")
1010

11-
set(Onnxruntime_VERSION "1.23.1")
11+
# v1.20.1 is the last version to support MacOS 12 v1.23.0 is the last version to support x86_64 on MacOS, as well as
12+
# MacOS 13
13+
set(Onnxruntime_VERSION "1.20.1")
1214

1315
if(CUSTOM_ONNXRUNTIME_URL STREQUAL "")
1416
set(USE_PREDEFINED_ONNXRUNTIME ON)
@@ -25,17 +27,17 @@ if(USE_PREDEFINED_ONNXRUNTIME)
2527

2628
if(APPLE)
2729
set(Onnxruntime_URL "${Onnxruntime_BASEURL}/onnxruntime-osx-universal2-${Onnxruntime_VERSION}.tgz")
28-
set(Onnxruntime_HASH SHA256=e9fcd200bcf69377cc2c15e529368ca840d625669f34b1cf296a56b175665fc2)
30+
set(Onnxruntime_HASH SHA256=da4349e01a7e997f5034563183c7183d069caadc1d95f499b560961787813efd)
2931
elseif(MSVC)
3032
set(Onnxruntime_URL "${Onnxruntime_BASEURL}/onnxruntime-win-x64-${Onnxruntime_VERSION}.zip")
31-
set(OOnnxruntime_HASH SHA256=d57817ee1e1aec8a7b4973ded0536f9be19ce0aa2152ff06a07952ed44790ed7)
33+
set(OOnnxruntime_HASH SHA256=78d447051e48bd2e1e778bba378bec4ece11191c9e538cf7b2c4a4565e8f5581)
3234
else()
3335
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64")
3436
set(Onnxruntime_URL "${Onnxruntime_BASEURL}/onnxruntime-linux-aarch64-${Onnxruntime_VERSION}.tgz")
35-
set(Onnxruntime_HASH SHA256=263267fa063c1a86d755268f492eabbc62887542c4a9417a21d628219805061a)
37+
set(Onnxruntime_HASH SHA256=ae4fedbdc8c18d688c01306b4b50c63de3445cdf2dbd720e01a2fa3810b8106a)
3638
else()
3739
set(Onnxruntime_URL "${Onnxruntime_BASEURL}/onnxruntime-linux-x64-gpu-${Onnxruntime_VERSION}.tgz")
38-
set(Onnxruntime_HASH SHA256=d759646b084888ded846f3be36aaadea24b62a19accba2d64ff9c2e3fb714a62)
40+
set(Onnxruntime_HASH SHA256=6bfb87c6ebe55367a94509b8ef062239e188dccf8d5caac8d6909b2344893bf0)
3941
endif()
4042
endif()
4143
else()

src/whisper-utils/silero-vad-onnx.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -103,12 +103,6 @@ const char* ort_error_code_str(OrtErrorCode code)
103103
return "INVALID_GRAPH";
104104
case OrtErrorCode::ORT_EP_FAIL:
105105
return "EP_FAIL";
106-
case OrtErrorCode::ORT_MODEL_LOAD_CANCELED:
107-
return "MODEL_LOAD_CANCELED";
108-
case OrtErrorCode::ORT_MODEL_REQUIRES_COMPILATION:
109-
return "MODEL_REQUIRES_COMPILATION";
110-
case OrtErrorCode::ORT_NOT_FOUND:
111-
return "NOT_FOUND";
112106
default:
113107
return "UNKNOWN_ERROR_CODE";
114108
}

0 commit comments

Comments
 (0)