From 3d829a136f71fbbd3bd669ddcbdce8ebc8997816 Mon Sep 17 00:00:00 2001 From: Jason Wang Date: Thu, 12 Feb 2026 10:56:53 +0800 Subject: [PATCH] fix: Fix the dataset can't load issue by unifying "values" keyword in tags object. --- .../app/module/annotation/utils/tag_converter.py | 6 +++--- .../datamate-python/app/module/dataset/service/service.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/runtime/datamate-python/app/module/annotation/utils/tag_converter.py b/runtime/datamate-python/app/module/annotation/utils/tag_converter.py index 357d7cc0..d084b8a5 100644 --- a/runtime/datamate-python/app/module/annotation/utils/tag_converter.py +++ b/runtime/datamate-python/app/module/annotation/utils/tag_converter.py @@ -104,7 +104,7 @@ def convert_simplified_to_full( "from_name": "label", "to_name": "image", "type": "choices", - "value": { + "values": { "choices": ["cat", "dog"] } } @@ -144,7 +144,7 @@ def convert_simplified_to_full( "from_name": from_name, "to_name": to_name, "type": control_type, - "value": { + "values": { control_type: values } } @@ -167,7 +167,7 @@ def is_simplified_format(self, tag: Dict[str, Any]) -> bool: # Simplified format has 'values' at top level and no 'type' field has_values = 'values' in tag has_type = 'type' in tag - has_value = 'value' in tag + has_value = 'values' in tag # If it has 'values' but no 'type', it's simplified # If it has 'type' and nested 'value', it's already full format diff --git a/runtime/datamate-python/app/module/dataset/service/service.py b/runtime/datamate-python/app/module/dataset/service/service.py index 290bd6f9..ff5869d7 100644 --- a/runtime/datamate-python/app/module/dataset/service/service.py +++ b/runtime/datamate-python/app/module/dataset/service/service.py @@ -179,7 +179,7 @@ async def update_file_tags_partial( 如果提供了 template_id,会自动将简化格式的标签转换为完整格式。 简化格式: {"from_name": "x", "to_name": "y", "values": [...]} - 完整格式: {"id": "...", "from_name": "x", "to_name": "y", "type": "...", "value": {"type": [...]}} + 完整格式: {"id": "...", "from_name": "x", "to_name": "y", "type": "...", "values": {"type": [...]}} Args: file_id: 文件ID