Skip to content

Commit

Permalink
Merge pull request #9 from langtech-bsc/create_annotation_status
Browse files Browse the repository at this point in the history
Create annotation status
  • Loading branch information
PaulNdrei authored Dec 5, 2024
2 parents 41ddbdd + bb788f2 commit 6a99827
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "galtea-sdk"
version = "0.1.3"
version = "0.1.4"
description = ""
authors = ["Nicola Massarenti", "Andrei Petrea"]
readme = "README.md"
Expand Down
8 changes: 6 additions & 2 deletions src/galtea/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def create_annotation_task(
users_path_file: Optional[str] = "users.json",
show_progress: bool = True,
export_records: bool = True
):
) -> bool:
"""
Create an annotation task with the specified parameters.
Expand Down Expand Up @@ -126,16 +126,20 @@ def create_annotation_task(
export_path = f"{self._dataset_manager.dataset.name}_{strftime('%Y-%m-%d_%H-%M-%S')}.json"
self._dataset_manager.dataset.records.to_json(export_path)
print(f"Exported dataset to {export_path}")

return True

except ValidationError as validation_error:
print(validation_error)
errors = convert_errors(validation_error, CUSTOM_MESSAGES)
for error in errors:
print(f"[ERROR]: {error['msg']}")
return False
except Exception as e:
print(f"Error creating annotation task: {e}")
import traceback
traceback.print_exc()

return False

def get_progress(self, dataset_name: str, workspace_name: str):
"""
Expand Down

0 comments on commit 6a99827

Please sign in to comment.