Hi HF mighty community,
I am getting following error when executing fine tuning NER code on Sagemaker.
ErrorMessage "ImportError: cannot import name ‘send_example_telemetry’ from ‘transformers.utils’ (/opt/conda/lib/python3.8/site-packages/transformers/utils/init.py)
I am able to fine tune the run_ner.py model on my local machine using latest version of Transformer library which is 4.21.0.dev0. However, when I try to run the model on Sagemaker, the training job is always failing throwing above Import error.
Sagemaker DLC code snippet:
huggingface_estimator = HuggingFace(
entry_point='run_ner.py',
source_dir='./token-classification',
instance_type='ml.p3.2xlarge',
instance_count=1,
role=role,
#git_config=git_config,
transformers_version='4.17.0',
pytorch_version='1.10.2',
py_version='py38',
hyperparameters = hyperparameters
)
I tried to update the transformer parameter in HuggingFace() to
transformers_version=‘4.21.0’, but i get following Value error.
ValueError: Unsupported huggingface version: 4.21.0. You may need to upgrade your SDK version (pip install -U sagemaker) for newer huggingface versions. Supported huggingface version(s): 4.4.2, 4.5.0, 4.6.1, 4.10.2, 4.11.0, 4.12.3, 4.17.0, 4.4, 4.5, 4.6, 4.10, 4.11, 4.12, 4.17
My hunch is, Sagemaker DLC is using older version of transformer, I am getting ImportError. Is there any way to upgrade the Sagemaker DLC transformer version or solve this issue in another way?
Thank you.
-Dinesh