Commit e3620dc
committed
fix(sagemaker-templates): Fix batch inference parameter resolution
The batch inference template was passing ParameterString objects directly
to job_arguments, which caused them to be serialized as literal JSON strings
instead of being resolved at runtime.
Root cause: ParameterString objects cannot be passed to job_arguments in
SageMaker SDK - they get serialized as '{"Get": "Parameters.Name"}' instead
of being resolved. This is unique to batch_inference template; all other
templates use hardcoded strings.
Solution:
- Use ProcessingInput to download file from S3 URL parameter
- Script finds CSV file in /opt/ml/processing/input/ directory
- Remove --input-data from job_arguments (can't pass parameters there)
This allows users to specify different input data via InputDataUrl parameter
while working around the SDK limitation.1 parent b5f4e37 commit e3620dc
2 files changed
Lines changed: 10 additions & 9 deletions
File tree
- modules/sagemaker/sagemaker-templates/templates/batch_inference/seed_code/build_app
- ml_pipelines/transformer
- source_scripts
Lines changed: 0 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
152 | 152 | | |
153 | 153 | | |
154 | 154 | | |
155 | | - | |
156 | | - | |
157 | 155 | | |
158 | 156 | | |
159 | 157 | | |
| |||
Lines changed: 10 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | | - | |
| 58 | + | |
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | | - | |
65 | | - | |
66 | 64 | | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
71 | 74 | | |
72 | 75 | | |
73 | 76 | | |
| |||
0 commit comments