Skip to content

Commit e1122ea

Browse files
committed
Merge branch 'fix/pattern3-fails' into 'develop'
Fix Pattern 3 classification config handling for SageMaker endpoint See merge request genaiic-reusable-assets/engagement-artifacts/genaiic-idp-accelerator!402
2 parents 5b3920a + c0da8a7 commit e1122ea

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.4.0-rc7
1+
0.4.0-rc8

patterns/pattern-3/src/classification_function/index.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -115,18 +115,15 @@ def handler(event, context):
115115
total_pages = len(document.pages)
116116
metrics.put_metric("ClassificationRequestsTotal", total_pages)
117117

118-
# Load configuration and update with SageMaker endpoint name
118+
# Load configuration - SageMaker endpoint is read from environment variable
119119
config = get_config(as_model=True)
120-
config_with_endpoint = config.to_dict(
121-
sagemaker_endpoint_name=os.environ["SAGEMAKER_ENDPOINT_NAME"]
122-
)
123120

124121
# Initialize classification service with SageMaker backend and DynamoDB caching
125122
cache_table = os.environ.get("TRACKING_TABLE")
126123
service = classification.ClassificationService(
127124
region=region,
128125
max_workers=MAX_WORKERS,
129-
config=config_with_endpoint,
126+
config=config,
130127
backend="sagemaker",
131128
cache_table=cache_table,
132129
)

0 commit comments

Comments
 (0)