Closed Adamwgoh closed 10 months ago
Hi @Adamwgoh, thanks for reaching out! As indicated in this doc, RegisterModel is to be deprecated and we're not supporting it. Could you try ModelStep and let us know if it can help in your use case?
You may need to slightly update your code to be something like:
model = HuggingFaceModel(
model_data="s3://finbert-tone/finbert.tar.gz",
entry_point="./hf_scripts/run_glue.py",
role=role,
transformers_version='4.26.0',
pytorch_version='1.13.1',
py_version='py39',
sagemaker_session=pipeline_session, # !!! the session must be a PipelineSession object
)
step_register_args = model.register(
content_types=["text/csv"],
response_types=["text/csv"],
inference_instances=["ml.t2.medium", "ml.m5.large"],
transform_instances=["ml.m5.large"],
model_package_group_name=model_package_group_name,
approval_status="PendingManualApproval",
framework="PYTORCH",
framework_version="1.13.1",
# any other args you need to pass to the register method
)
model_step = ModelStep(
name="MyModelStep",
step_args=step_register_args,
)
@Adamwgoh Did it fix your issue? Shall we close this?
@Adamwgoh Did it fix your issue? Shall we close this?
Hi @martinRenou I have yet to test it. Let me do test it by next week and get back to you if that's okay ?
Sure! Thank you for reaching back
@martinRenou tested this and the new ModelStep
works. Thanks
Describe the bug
RegisterModel
fail when not provided withimage_uri
, even whenHuggingFaceModel
has all the given specified version needed to query for HuggingFace AWS ECR Inference Container To reproduceBased on the following pipeline steps, I realize that unless I provide a model_uri directly (such as using
get_huggingface_llm_image_uri
, it will not be parseframework
andframework_version
over to RegisterModelStep, and cause an error. When we run HuggingfaceModel(() directly, it will query based onframework
,pytorch_version
etc to get the correct inference container. However, I seem to struggle with doing the same with the following pipeline.Is there reason why framework is excluded from being parsed when
image_uri
does not exist, undersagemaker/workflow/_utils.py: _RegisterModelStep
?Expected behavior Error is:
ValueError: Unsupported base framework: None. You may need to upgrade your SDK version (pip install -U sagemaker) for newer base frameworks. Supported base framework(s): version_aliases, pytorch1.13.1, tensorflow2.11.0.
Expected behavior is to parse them for huggingface and pull respective ECR inference containerScreenshots or logs If applicable, add screenshots or logs to help explain your problem.
System information A description of your system. Please provide:
Additional context Add any other context about the problem here.