- Newest
- Most votes
- Most comments
The error you're encountering, ValueError: Error raised by inference endpoint: An error occurred (ValidationError) when calling the InvokeEndpoint operation: Inference Component Name header is required for endpoints to which you plan to deploy inference components, suggests that the request made to the SageMaker endpoint is missing a required header. This header is the Inference Component Name which is necessary for invoking the endpoint, especially when dealing with inference components.
The issue seems to be with how the request is being made to the SageMaker endpoint. To resolve this error, you need to include the Inference Component Name header in your endpoint invocation request. You need to add the Inference Component Name header to the endpoint_kwargs. Since you are already using CustomAttributes, you can append this additional header to it. llm = SagemakerEndpoint( endpoint_name=endpoint_name, region_name=region, model_kwargs={"max_new_tokens": 700, "top_p": 0.9, "temperature": 0.6}, endpoint_kwargs={ "CustomAttributes": 'accept_eula=true,InferenceComponentName=MyInferenceComponent' }, content_handler=content_handler )
answered 3 years ago
Relevant content
asked 3 years ago
asked 2 years ago
asked 2 years ago
asked 2 years ago

I have tried
and also as you suggested
both the case's i am getting same error
ValueError: Error raised by inference endpoint: An error occurred (ValidationError) when calling the InvokeEndpoint operation: Inference Component Name header is required for endpoints to which you plan to deploy inference components. Please include Inference Component Name header or consider using SageMaker models.
@Dipika I found that I had to pass the inference component name directly to endpoint args, rather than as part of custom attributes, like the following: