aws / aws/amazon-sagemaker-examples

[Bug Report] NameError: Field name "json" shadows a BaseModel attribute; use a different field name with "alias='json'" when running example notebook for sagemaker_core (sagemaker-core/sagemaker-core-llama-3-8B.ipynb)

Open
#4,766 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Jupyter Notebook
Stars
11k
Forks
7k
Avg merge
8h 29m
Merged PRs (30d)
8

Description

**Link to the notebook**
sagemaker-core/sagemaker-core-llama-3-8B.ipynb

**Describe the bug**
When running the example notebook in SageMaker Studio v2, I got the following error:
```python
from sagemaker_core.shapes import ContainerDefinition, ProductionVariant
from sagemaker_core.resources import Model, EndpointConfig, Endpoint
from time import gmtime, strftime

│ in :1 │
│ │
│ ❱ 1 from sagemaker_core.shapes import ContainerDefinition, ProductionVariant │
│ 2 #from sagemaker_core.resources import Model, EndpointConfig, Endpoint │
│ 3 #from time import gmtime, strftime │
│ 4 │
│ │
│ /opt/conda/lib/python3.11/site-packages/sagemaker_core/shapes/__init__.py:1 in │
│ │
│ ❱ 1 from ..main.shapes import * │
│ 2 │
│ │
│ /opt/conda/lib/python3.11/site-packages/sagemaker_core/main/shapes.py:2478 in │
│ │
│ 2475 │ """ │
│ 2476 │
│ 2477 │
│ ❱ 2478 class MonitoringDatasetFormat(Base): │
│ 2479 │ """ │
│ 2480 │ MonitoringDatasetFormat │
│ 2481 │ Represents the dataset format used when running a monitoring job. │
│ │
│ in pydantic.main.ModelMetaclass.__new__:186 │
│ │
│ in pydantic.utils.validate_field_name:167 │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
NameError: Field name "json" shadows a BaseModel attribute; use a different field name with "alias='json'".
```

**To reproduce**
Run the example notebook in SageMaker Studio V2.

**Logs**
If applicable, add logs to help explain your problem.
You may also attach an `.ipynb` file to this issue if it includes relevant logs or output.

Contributor guide

Open the contributing guide

Research direction

Start by running sagemaker-core/sagemaker-core-llama-3-8B.ipynb in SageMaker Studio V2 and reproduce the import failure from sagemaker_core.shapes. Trace the reported field-name error during the notebook's imports, then verify that the notebook runs without the NameError.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, jupyter-notebook, python
Domain
cloud, machine-learning
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 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.