aws / aws/sagemaker-core

notebooks in examples folders, they are getting errors for inferencing

Open
#242 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
Python
Stars
24
Forks
25
PR merge metrics
No merged PRs in 30d

Description

in both get_started.ipynb and inference_and_resource_chaining.ipynb, the cells that have .invoke are failing

invoke_result = endpoint.invoke(body=serializer.serialize(test_data_no_target),
content_type='text/csv',
accept='text/csv')

in :7 │
│ │
│ 4 deserializer = CSVDeserializer() │
│ 5 serializer = CSVSerializer() │
│ 6 │
│ ❱ 7 invoke_result = endpoint.invoke(body=serializer.serialize(test_data_no_target), │
│ 8 │ │ │ │ │ │ │ │ content_type='text/csv', │
│ 9 │ │ │ │ │ │ │ │ accept='text/csv') │
│ 10 │
│ │
│ /opt/conda/lib/python3.11/site-packages/sagemaker_core/main/resources.py:136 in wrapper │
│ │
│ 133 │ │ @functools.wraps(func) │
│ 134 │ │ def wrapper(*args, **kwargs): │
│ 135 │ │ │ config = dict(arbitrary_types_allowed=True) │
│ ❱ 136 │ │ │ return validate_call(config=config)(func)(*args, **kwargs) │
│ 137 │ │ │
│ 138 │ │ return wrapper │
│ 139 │
│ │
│ /opt/conda/lib/python3.11/site-packages/pydantic/_internal/_validate_call.py:38 in │
│ wrapper_function │
│ │
│ 35 │ │ │
│ 36 │ │ @functools.wraps(wrapped) │
│ 37 │ │ def wrapper_function(*args, **kwargs): │
│ ❱ 38 │ │ │ return wrapper(*args, **kwargs) │
│ 39 │ │
│ 40 │ # We need to manually update this because `partial` object has no `__name__` and `__ │
│ 41 │ wrapper_function.__name__ = extract_function_name(wrapped) │
│ │
│ /opt/conda/lib/python3.11/site-packages/pydantic/_internal/_validate_call.py:111 in __call__ │
│ │
│ 108 │ │ │ self.__return_pydantic_validator__ = None │
│ 109 │ │
│ 110 │ def __call__(self, *args: Any, **kwargs: Any) -> Any: │
│ ❱ 111 │ │ res = self.__pydantic_validator__.validate_python(pydantic_core.ArgsKwargs(args, │
│ 112 │ │ if self.__return_pydantic_validator__: │
│ 113 │ │ │ return self.__return_pydantic_validator__(res) │
│ 114 │ │ else: │
│ │
│ /opt/conda/lib/python3.11/site-packages/sagemaker_core/main/resources.py:9441 in invoke │
│ │
│ 9438 │ │ response = client.invoke_endpoint(**operation_input_args) │
│ 9439 │ │ logger.debug(f"Response: {response}") │
│ 9440 │ │ │
│ ❱ 9441 │ │ transformed_response = transform(response, "InvokeEndpointOutput") │
│ 9442 │ │ return InvokeEndpointOutput(**transformed_response) │
│ 9443 │ │
│ 9444 │ @Base.add_validate_call │
│ │
│ /opt/conda/lib/python3.11/site-packages/sagemaker_core/main/code_injection/codec.py:248 in │
│ transform │
│ │
│ 245 │ │ │ _map_type_shape = SHAPE_DAG[_member_shape] │
│ 246 │ │ │ evaluated_value = _evaluate_map_type(data[_member_name], _map_type_shape) │
│ 247 │ │ else: │
│ ❱ 248 │ │ │ raise ValueError(f"Unexpected member type encountered: {_member_type}") │
│ 249 │ │ │
│ 250 │ │ result[attribute_name] = evaluated_value │
│ 251 │ │ if object_instance: │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
ValueError: Unexpected member type encountered: blob

I am running notebooks inside sagemaker Jupyter

my sagemaker-core version is this

Name: sagemaker-core
Version: 1.0.21
Summary: An python package for sagemaker core functionalities
Home-page:
Author:
Author-email: AWS
License:
Location: /opt/conda/lib/python3.11/site-packages
Requires: boto3, importlib-metadata, jsonschema, mock, platformdirs, pydantic, PyYAML, rich
Required-by: sagemaker
Metadata-Version: 2.2
Installer: pip
Classifiers:
Development Status :: 3 - Alpha
Intended Audience :: Developers
License :: OSI Approved :: Apache Software License
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Programming Language :: Python :: 3.12
Entry-points:
Project-URLs:
Repository, https://github.com/aws/sagemaker-core.git

Contributor guide

Open the contributing guide

Research direction

Start by opening get_started.ipynb and inference_and_resource_chaining.ipynb in SageMaker Jupyter and rerun the cells containing endpoint.invoke. Compare the failures with the sagemaker-core 1.0.21 traceback, and consider the work complete when both notebooks run those inference cells without the reported ValueError.

Written by the indexing model from the issue text.

Assessment

Tech stack
jupyter-notebook, python
Domain
documentation
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.