Skip to content

Commit

Permalink
Change ModelConfigName to a vanilla enum, since StrEnum doesn't exist…
Browse files Browse the repository at this point in the history
… in python 3.10.

PiperOrigin-RevId: 688625491
  • Loading branch information
sdenton4 authored and copybara-github committed Oct 22, 2024
1 parent 2f9a142 commit 1b654c1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions chirp/projects/zoo/model_configs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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'
Expand Down

0 comments on commit 1b654c1

Please sign in to comment.