From 16e29785c9be50e6a165173ccaf8551a0c6f2e27 Mon Sep 17 00:00:00 2001 From: Tom Denton Date: Mon, 21 Oct 2024 14:07:30 -0700 Subject: [PATCH] Change ModelConfigName to a vanilla enum, since StrEnum doesn't exist in python 3.10. PiperOrigin-RevId: 688266504 --- chirp/projects/zoo/model_configs.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chirp/projects/zoo/model_configs.py b/chirp/projects/zoo/model_configs.py index ce46b860..5090be61 100644 --- a/chirp/projects/zoo/model_configs.py +++ b/chirp/projects/zoo/model_configs.py @@ -24,7 +24,7 @@ from ml_collections import config_dict -class ModelConfigName(enum.StrEnum): +class ModelConfigName(enum.Enum): """Names of known preset configs.""" BEANS_BASELINE = 'beans_baseline' @@ -100,7 +100,7 @@ def get_preset_model_config(preset_name: str | ModelConfigName): model_config.model_path = '' elif preset_name.value.startswith('birdnet'): model_key = 'birdnet' - birdnet_version = preset_name.split('_')[-1] + birdnet_version = preset_name.value.split('_')[-1] if birdnet_version not in ('V2.1', 'V2.2', 'V2.3'): raise ValueError(f'Birdnet version not supported: {birdnet_version}') base_path = 'gs://chirp-public-bucket/models/birdnet'