Skip to content

Commit

Permalink
fix: use pipeline key for slug, not model'a
Browse files Browse the repository at this point in the history
  • Loading branch information
mihow committed Jan 26, 2025
1 parent 8e2c885 commit f51068c
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions trapdata/api/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,11 @@ def make_algorithm_config_response(

def make_pipeline_config_response(
Classifier: type[APIMothClassifier],
slug: str,
) -> PipelineConfigResponse:
"""
Create a configuration for an entire pipeline, given a species classifier class.
"""
detector = APIMothDetector(
source_images=[],
)
Expand All @@ -128,7 +132,7 @@ def make_pipeline_config_response(

return PipelineConfigResponse(
name=classifier.name,
slug=classifier.get_key(),
slug=slug,
description=classifier.description,
version=1,
algorithms=[
Expand All @@ -141,8 +145,8 @@ def make_pipeline_config_response(

# @TODO This requires loading all models into memory! Can we avoid this?
PIPELINE_CONFIGS = [
make_pipeline_config_response(classifier_class)
for classifier_class in CLASSIFIER_CHOICES.values()
make_pipeline_config_response(classifier_class, slug=key)
for key, classifier_class in CLASSIFIER_CHOICES.items()
]


Expand Down

0 comments on commit f51068c

Please sign in to comment.