Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[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) #4766

Open
dsoldatkin opened this issue Oct 9, 2024 · 1 comment

Comments

@dsoldatkin
Copy link

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:

from sagemaker_core.shapes import ContainerDefinition, ProductionVariant
from sagemaker_core.resources import Model, EndpointConfig, Endpoint
from time import gmtime, strftimein <module>: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 <module>          │
│                                                                                                  │
│ ❱ 1 from ..main.shapes import *                                                                  │
│   2                                                                                              │
│                                                                                                  │
│ /opt/conda/lib/python3.11/site-packages/sagemaker_core/main/shapes.py:2478 in <module>           │
│                                                                                                  │
│    2475"""                                                                                  │
│    2476                                                                                          │
│    2477                                                                                          │
│ ❱  2478 class MonitoringDatasetFormat(Base):                                                     │
│    2479 │   """                                                                                  │
│    2480MonitoringDatasetFormat                                                              │
│    2481Represents 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.

@HubGab-Git
Copy link

Hi @dsoldatkin try to change pip install with pydantic like below:

%pip install sagemaker-core huggingface_hub pydantic --upgrade --quiet

later there can be also error with deploying endpoint I sugest to deploy llama 3 like in below notebook using jumpstart:

sm-jumpstart_foundation_llama_3_text_completion.ipynb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants