Skip to content

Commit 1709312

Browse files
committed
Merge branch 'dev' into queue_problem_macos
2 parents 88150d8 + 8784051 commit 1709312

1 file changed

Lines changed: 12 additions & 6 deletions

File tree

src/birdnet_tests/backends_py/test_load_tf_model.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import platform
2+
13
import pytest
24

35
from birdnet.acoustic_models.v2_4.tf import AcousticTFDownloaderV2_4
@@ -21,10 +23,8 @@ def test_load_tf_and_litert_after_each_other_is_not_possible() -> None:
2123
assert model_tf is not None
2224

2325
# Loading Litert model after TF fails
24-
with pytest.raises(
25-
ImportError,
26-
match=r"generic_type: type \"InterpreterWrapper\" is already registered!",
27-
):
26+
# Error message differs between platforms
27+
with pytest.raises(ImportError):
2828
load_tf_model(model_path, library="litert", allocate_tensors=False)
2929

3030

@@ -41,5 +41,11 @@ def test_load_litert_and_tf_after_each_other_is_possible() -> None:
4141
assert model_litert is not None
4242

4343
# Load TF model
44-
model_tf = load_tf_model(model_path, library="tf", allocate_tensors=False)
45-
assert model_tf is not None
44+
# on macOS it can't be loaded after liteRT
45+
if platform.system() == "Darwin":
46+
# Loading Litert model after TF fails
47+
with pytest.raises(ImportError):
48+
load_tf_model(model_path, library="tf", allocate_tensors=False)
49+
else:
50+
model_tf = load_tf_model(model_path, library="tf", allocate_tensors=False)
51+
assert model_tf is not None

0 commit comments

Comments
 (0)