Skip to content

Commit a715113

Browse files
authored
Update onnxruntime-extension (#1160)
1 parent 7b88a47 commit a715113

File tree

3 files changed

+11
-10
lines changed

3 files changed

+11
-10
lines changed

build.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -505,6 +505,13 @@ def update(args: argparse.Namespace, env: dict[str, str]):
505505
"-DPLATFORM_NAME=" + platform_name,
506506
]
507507

508+
if args.ios or args.macos == "Catalyst" or args.build_apple_framework:
509+
command += [
510+
"-DENABLE_PYTHON=OFF",
511+
"-DENABLE_TESTS=OFF",
512+
"-DENABLE_MODEL_BENCHMARK=OFF",
513+
]
514+
508515
if args.macos:
509516
command += [
510517
f"-DCMAKE_OSX_SYSROOT={args.apple_sysroot}",
@@ -531,9 +538,6 @@ def _get_opencv_toolchain_file():
531538
f"-DIPHONEOS_DEPLOYMENT_TARGET={args.apple_deploy_target}",
532539
# The following arguments are specific to the OpenCV toolchain file
533540
f"-DCMAKE_TOOLCHAIN_FILE={_get_opencv_toolchain_file()}",
534-
"-DENABLE_PYTHON=OFF",
535-
"-DENABLE_TESTS=OFF",
536-
"-DENABLE_MODEL_BENCHMARK=OFF",
537541
]
538542

539543
if args.macos == "Catalyst":
@@ -552,9 +556,6 @@ def _get_opencv_toolchain_file():
552556
f"-DCMAKE_CC_FLAGS=--target={macabi_target}",
553557
f"-DCMAKE_CC_FLAGS_RELEASE=-O3 -DNDEBUG --target={macabi_target}",
554558
"-DMAC_CATALYST=1",
555-
"-DENABLE_PYTHON=OFF",
556-
"-DENABLE_TESTS=OFF",
557-
"-DENABLE_MODEL_BENCHMARK=OFF",
558559
]
559560

560561
if args.arm64:

cmake/deps.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ pybind11;https://github.com/pybind/pybind11/archive/refs/tags/v2.10.1.zip;769b6a
1414
googletest;https://github.com/google/googletest/archive/530d5c8c84abd2a46f38583ee817743c9b3a42b4.zip;5e3a61db2aa975cfd0f97ba92c818744e7fa7034
1515
microsoft_wil;https://github.com/microsoft/wil/archive/refs/tags/v1.0.230629.1.zip;e4a542a323c070376f7c2d1973d0f7ddbc1d2fa5
1616
directx_headers;https://github.com/microsoft/DirectX-Headers/archive/refs/tags/v1.613.1.zip;47653509a3371eabb156360f42faf582f314bf2e
17-
onnxruntime_extensions;https://github.com/microsoft/onnxruntime-extensions.git;2c3e936cfc3401ba7ebb79d02b9e52a50439ffc3
17+
onnxruntime_extensions;https://github.com/microsoft/onnxruntime-extensions.git;4e10ee046a2f035351f3fe88740bd8215a18fdb9

src/models/audio_processor.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ std::unique_ptr<Audios> LoadAudios(const std::span<const char* const>& audio_pat
4545
}
4646
}
4747
ort_extensions::OrtxObjectPtr<OrtxRawAudios> audios;
48-
CheckResult(OrtxLoadAudios(ort_extensions::ptr(audios), audio_paths.data(), audio_paths.size()));
48+
CheckResult(OrtxLoadAudios(audios.ToBeAssigned(), audio_paths.data(), audio_paths.size()));
4949

5050
return std::make_unique<Audios>(std::move(audios), audio_paths.size());
5151
}
@@ -68,10 +68,10 @@ std::unique_ptr<NamedTensors> AudioProcessor::Process(const Audios* audios) cons
6868
auto named_tensors = std::make_unique<NamedTensors>();
6969

7070
ort_extensions::OrtxObjectPtr<OrtxTensorResult> result;
71-
CheckResult(OrtxSpeechLogMel(processor_.get(), audios->audios_.get(), ort_extensions::ptr(result)));
71+
CheckResult(OrtxSpeechLogMel(processor_.get(), audios->audios_.get(), result.ToBeAssigned()));
7272

7373
ort_extensions::OrtxObjectPtr<OrtxTensor> mel;
74-
CheckResult(OrtxTensorResultGetAt(result.get(), 0, ort_extensions::ptr(mel)));
74+
CheckResult(OrtxTensorResultGetAt(result.get(), 0, mel.ToBeAssigned()));
7575

7676
named_tensors->emplace(std::string(Config::Defaults::InputFeaturesName),
7777
std::make_shared<Tensor>(ProcessMel(mel, input_features_type_, allocator)));

0 commit comments

Comments
 (0)