Skip to content

Commit

Permalink
making list_samples endpoint robust to stale predictions
Browse files Browse the repository at this point in the history
  • Loading branch information
beijbom committed Jun 17, 2024
1 parent 4543d8c commit 9acf62d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ packages = ["src/nyckel"]

[project]
name = "nyckel"
version = "0.4.11"
version = "0.4.12"
authors = [{ name = "Oscar Beijbom", email = "[email protected]" }]
description = "Python package for the Nyckel API"
readme = "README.md"
Expand Down
4 changes: 4 additions & 0 deletions src/nyckel/functions/tags/tabular_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,12 +308,16 @@ def _sample_from_dict(
annotation = None

if "prediction" in sample_dict:
# TODO: Note that we filter out predictsion that are not in the label list.
# This is a temporary fix since these should not be there in the first place.

prediction = [
ClassificationPrediction(
confidence=entry["confidence"],
label_name=label_name_by_id[strip_nyckel_prefix(entry["labelId"])],
)
for entry in sample_dict["prediction"]
if strip_nyckel_prefix(entry["labelId"]) in label_name_by_id
]
else:
prediction = None
Expand Down

0 comments on commit 9acf62d

Please sign in to comment.