synapse-sdk 1.0.0b10__py3-none-any.whl → 1.0.0b11__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of synapse-sdk might be problematic. Click here for more details.
- synapse_sdk/plugins/categories/pre_annotation/actions/to_task.py +27 -7
- {synapse_sdk-1.0.0b10.dist-info → synapse_sdk-1.0.0b11.dist-info}/METADATA +1 -1
- {synapse_sdk-1.0.0b10.dist-info → synapse_sdk-1.0.0b11.dist-info}/RECORD +7 -7
- {synapse_sdk-1.0.0b10.dist-info → synapse_sdk-1.0.0b11.dist-info}/WHEEL +0 -0
- {synapse_sdk-1.0.0b10.dist-info → synapse_sdk-1.0.0b11.dist-info}/entry_points.txt +0 -0
- {synapse_sdk-1.0.0b10.dist-info → synapse_sdk-1.0.0b11.dist-info}/licenses/LICENSE +0 -0
- {synapse_sdk-1.0.0b10.dist-info → synapse_sdk-1.0.0b11.dist-info}/top_level.txt +0 -0
|
@@ -163,6 +163,10 @@ class ToTaskRun(Run):
|
|
|
163
163
|
'message': 'Inference annotation completed. Success: {}, Failed: {}',
|
|
164
164
|
'level': None,
|
|
165
165
|
},
|
|
166
|
+
'INFERENCE_PREPROCESSOR_FAILED': {
|
|
167
|
+
'message': 'Inference pre processor failed for task {}: {}',
|
|
168
|
+
'level': Context.DANGER,
|
|
169
|
+
},
|
|
166
170
|
}
|
|
167
171
|
|
|
168
172
|
def log_message_with_code(self, code: str, *args, level: Optional[Context] = None):
|
|
@@ -658,6 +662,8 @@ class ToTaskAction(Action):
|
|
|
658
662
|
# Get pre-processor information
|
|
659
663
|
pre_processor_info = self._get_pre_processor_info(client, pre_processor_id)
|
|
660
664
|
if not pre_processor_info['success']:
|
|
665
|
+
error_msg = pre_processor_info.get('error', 'Failed to get pre-processor info')
|
|
666
|
+
self.run.log_annotate_task_event('INFERENCE_PREPROCESSOR_FAILED', task_id, error_msg)
|
|
661
667
|
return pre_processor_info
|
|
662
668
|
|
|
663
669
|
pre_processor_code = pre_processor_info['code']
|
|
@@ -666,6 +672,8 @@ class ToTaskAction(Action):
|
|
|
666
672
|
# Ensure pre-processor is running
|
|
667
673
|
pre_processor_status = self._ensure_pre_processor_running(client, pre_processor_code)
|
|
668
674
|
if not pre_processor_status['success']:
|
|
675
|
+
error_msg = pre_processor_status.get('error', 'Failed to ensure pre-processor running')
|
|
676
|
+
self.run.log_annotate_task_event('INFERENCE_PREPROCESSOR_FAILED', task_id, error_msg)
|
|
669
677
|
return pre_processor_status
|
|
670
678
|
|
|
671
679
|
# Extract primary file URL from task data
|
|
@@ -679,20 +687,23 @@ class ToTaskAction(Action):
|
|
|
679
687
|
# Run inference
|
|
680
688
|
inference_result = self._run_inference(client, pre_processor_code, pre_processor_version, primary_file_url)
|
|
681
689
|
if not inference_result['success']:
|
|
690
|
+
error_msg = inference_result.get('error', 'Failed to run inference')
|
|
691
|
+
self.run.log_annotate_task_event('INFERENCE_PREPROCESSOR_FAILED', task_id, error_msg)
|
|
682
692
|
return inference_result
|
|
683
693
|
|
|
684
694
|
# Convert and submit inference data
|
|
685
|
-
|
|
686
|
-
|
|
695
|
+
try:
|
|
696
|
+
annotation_to_task = self.entrypoint(self.run)
|
|
697
|
+
converted_result = annotation_to_task.convert_data_from_inference(inference_result['data'])
|
|
698
|
+
except Exception as e:
|
|
699
|
+
error_msg = f'Failed to convert inference data: {str(e)}'
|
|
700
|
+
self.run.log_annotate_task_event('INFERENCE_PREPROCESSOR_FAILED', task_id, error_msg)
|
|
701
|
+
return {'success': False, 'error': error_msg}
|
|
687
702
|
|
|
688
703
|
# Submit inference annotation data
|
|
689
704
|
client.annotate_task_data(task_id, data={'action': 'submit', 'data': converted_result})
|
|
690
705
|
|
|
691
|
-
|
|
692
|
-
self.run.log_annotate_task_data(
|
|
693
|
-
{'task_id': task_id, 'pre_processor_id': pre_processor_id}, AnnotateTaskDataStatus.SUCCESS
|
|
694
|
-
)
|
|
695
|
-
return {'success': True}
|
|
706
|
+
return {'success': True, 'pre_processor_id': pre_processor_id}
|
|
696
707
|
|
|
697
708
|
except Exception as e:
|
|
698
709
|
error_msg = f'Failed to process inference for task {task_id}: {str(e)}'
|
|
@@ -926,8 +937,17 @@ class ToTaskAction(Action):
|
|
|
926
937
|
result = self._process_single_task(client, task_id, task_params, None, AnnotationMethod.INFERENCE)
|
|
927
938
|
if result['success']:
|
|
928
939
|
success_count += 1
|
|
940
|
+
pre_processor_id = result.get('pre_processor_id')
|
|
941
|
+
task_data = {'task_id': task_id}
|
|
942
|
+
if pre_processor_id:
|
|
943
|
+
task_data['pre_processor_id'] = pre_processor_id
|
|
944
|
+
self.run.log_annotate_task_data(task_data, AnnotateTaskDataStatus.SUCCESS)
|
|
929
945
|
else:
|
|
930
946
|
failed_count += 1
|
|
947
|
+
error_msg = result.get('error', 'Unknown error')
|
|
948
|
+
self.run.log_annotate_task_data(
|
|
949
|
+
{'task_id': task_id, 'error': error_msg}, AnnotateTaskDataStatus.FAILED
|
|
950
|
+
)
|
|
931
951
|
|
|
932
952
|
current_progress += 1
|
|
933
953
|
self._update_metrics(total_tasks, success_count, failed_count)
|
|
@@ -141,7 +141,7 @@ synapse_sdk/plugins/categories/post_annotation/templates/plugin/post_annotation.
|
|
|
141
141
|
synapse_sdk/plugins/categories/pre_annotation/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
142
142
|
synapse_sdk/plugins/categories/pre_annotation/actions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
143
143
|
synapse_sdk/plugins/categories/pre_annotation/actions/pre_annotation.py,sha256=6ib3RmnGrjpsQ0e_G-mRH1lfFunQ3gh2M831vuDn7HU,344
|
|
144
|
-
synapse_sdk/plugins/categories/pre_annotation/actions/to_task.py,sha256=
|
|
144
|
+
synapse_sdk/plugins/categories/pre_annotation/actions/to_task.py,sha256=MMco4fvC_R36FMrrsubHfvXolCstGL3mdxhDKxUCT3s,41987
|
|
145
145
|
synapse_sdk/plugins/categories/pre_annotation/templates/config.yaml,sha256=VREoCp9wsvZ8T2E1d_MEKlR8TC_herDJGVQtu3ezAYU,589
|
|
146
146
|
synapse_sdk/plugins/categories/pre_annotation/templates/plugin/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
147
147
|
synapse_sdk/plugins/categories/pre_annotation/templates/plugin/pre_annotation.py,sha256=HBHxHuv2gMBzDB2alFfrzI_SZ1Ztk6mo7eFbR5GqHKw,106
|
|
@@ -211,9 +211,9 @@ synapse_sdk/utils/storage/providers/gcp.py,sha256=i2BQCu1Kej1If9SuNr2_lEyTcr5M_n
|
|
|
211
211
|
synapse_sdk/utils/storage/providers/http.py,sha256=2DhIulND47JOnS5ZY7MZUex7Su3peAPksGo1Wwg07L4,5828
|
|
212
212
|
synapse_sdk/utils/storage/providers/s3.py,sha256=ZmqekAvIgcQBdRU-QVJYv1Rlp6VHfXwtbtjTSphua94,2573
|
|
213
213
|
synapse_sdk/utils/storage/providers/sftp.py,sha256=_8s9hf0JXIO21gvm-JVS00FbLsbtvly4c-ETLRax68A,1426
|
|
214
|
-
synapse_sdk-1.0.
|
|
215
|
-
synapse_sdk-1.0.
|
|
216
|
-
synapse_sdk-1.0.
|
|
217
|
-
synapse_sdk-1.0.
|
|
218
|
-
synapse_sdk-1.0.
|
|
219
|
-
synapse_sdk-1.0.
|
|
214
|
+
synapse_sdk-1.0.0b11.dist-info/licenses/LICENSE,sha256=bKzmC5YAg4V1Fhl8OO_tqY8j62hgdncAkN7VrdjmrGk,1101
|
|
215
|
+
synapse_sdk-1.0.0b11.dist-info/METADATA,sha256=ls-9thXDeUa4ngm-00SUcPWhL7CCacR8ZaWfCihygfo,3745
|
|
216
|
+
synapse_sdk-1.0.0b11.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
217
|
+
synapse_sdk-1.0.0b11.dist-info/entry_points.txt,sha256=VNptJoGoNJI8yLXfBmhgUefMsmGI0m3-0YoMvrOgbxo,48
|
|
218
|
+
synapse_sdk-1.0.0b11.dist-info/top_level.txt,sha256=ytgJMRK1slVOKUpgcw3LEyHHP7S34J6n_gJzdkcSsw8,12
|
|
219
|
+
synapse_sdk-1.0.0b11.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|