Skip to content

Commit 4dd53f1

Browse files
committed
Updates to the service
1 parent 0a27664 commit 4dd53f1

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

lib/idp_common_pkg/idp_common/evaluation/stickler_service.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,16 +84,23 @@ def _load_stickler_models(self) -> None:
8484

8585
def _load_extraction_results(self, uri: str) -> Dict[str, Any]:
8686
"""
87-
Load extraction results from S3.
87+
Load extraction results from S3 or local file.
8888
8989
Args:
90-
uri: S3 URI to the extraction results
90+
uri: S3 URI or file:// URI to the extraction results
9191
9292
Returns:
9393
Dictionary of extraction results
9494
"""
9595
try:
96-
content = s3.get_json_content(uri)
96+
# Handle local file paths (file:// URIs)
97+
if uri.startswith("file://"):
98+
file_path = uri.replace("file://", "")
99+
with open(file_path, 'r') as f:
100+
content = json.load(f)
101+
else:
102+
# Handle S3 URIs
103+
content = s3.get_json_content(uri)
97104

98105
# Check if results are wrapped in inference_result key
99106
if isinstance(content, dict) and "inference_result" in content:

0 commit comments

Comments
 (0)