Skip to content

Commit

Permalink
fix: llm exports always all labels (#1729)
Browse files Browse the repository at this point in the history
  • Loading branch information
baptiste-olivier committed Jun 28, 2024
1 parent f7f4bff commit 11bfd2b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/kili/presentation/client/label.py
Original file line number Diff line number Diff line change
Expand Up @@ -1229,7 +1229,7 @@ def is_rectangle(coco_annotation, coco_image, kili_annotation):
self, # pyright: ignore[reportGeneralTypeIssues]
asset_ids=resolved_asset_ids,
project_id=ProjectId(project_id),
export_type="latest",
export_type="normal" if fmt == "llm_v1" else "latest",
label_format=fmt,
split_option=layout,
single_file=single_file,
Expand Down
23 changes: 13 additions & 10 deletions src/kili/services/export/format/llm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,23 +54,26 @@ def process(self, assets: List[Dict]) -> List[Dict[str, Union[List[str], str]]]:
def _process(self, assets: List[Dict]) -> List[Dict[str, Union[List[str], str]]]:
result = []
for asset in assets:
jobs_config = self.project["jsonInterface"]["jobs"]
latest_label = asset["latestLabel"]
result.append(
{
"raw_data": _format_raw_data(asset),
"status": asset["status"],
"external_id": asset["externalId"],
"metadata": asset["jsonMetadata"],
"labels": [
{
"author": latest_label["author"]["email"],
"created_at": latest_label["createdAt"],
"label_type": latest_label["labelType"],
"label": _format_json_response(
jobs_config, latest_label["jsonResponse"]
),
}
list(
map(
lambda label: {
"author": label["author"]["email"],
"created_at": label["createdAt"],
"label_type": label["labelType"],
"label": _format_json_response(
self.project["jsonInterface"]["jobs"], label["jsonResponse"]
),
},
asset["labels"],
)
)
],
}
)
Expand Down

0 comments on commit 11bfd2b

Please sign in to comment.