SeanLee97 / AnglE

Train and Infer Powerful Sentence Embeddings with AnglE | 🔥 SOTA on STS and MTEB Leaderboard
https://arxiv.org/abs/2309.12871
MIT License
493 stars 33 forks source link

Issue on Sagemaker #47

Closed rajandevkota98 closed 8 months ago

rajandevkota98 commented 9 months ago

I am facing while deploying embedded model on AWS sagemaker. I ran the same script given in hugging face but got error: ModelError Traceback (most recent call last) Cell In[5], line 32 26 # deploy model to SageMaker Inference 27 predictor = huggingface_model.deploy( 28 initial_instance_count=1, # number of instances 29 instance_type='ml.r5d.12xlarge' # ec2 instance type 30 ) ---> 32 predictor.predict({ 33 "inputs": "Today is a sunny day and I will get some ice cream.", 34 })

File ~/anaconda3/envs/pytorch_p310/lib/python3.10/site-packages/sagemaker/base_predictor.py:167, in Predictor.predict(self, data, initial_args, target_model, target_variant, inference_id) 137 """Return the inference from the specified endpoint. 138 139 Args: (...) 161 as is. 162 """ 164 request_args = self._create_request_args( 165 data, initial_args, target_model, target_variant, inference_id 166 ) --> 167 response = self.sagemaker_session.sagemaker_runtime_client.invoke_endpoint(**request_args) 168 return self._handle_response(response)

File ~/anaconda3/envs/pytorch_p310/lib/python3.10/site-packages/botocore/client.py:553, in ClientCreator._create_api_method.._api_call(self, *args, **kwargs) 549 raise TypeError( 550 f"{py_operation_name}() only accepts keyword arguments." 551 ) 552 # The "self" in this scope is referring to the BaseClient. --> 553 return self._make_api_call(operation_name, kwargs)

File ~/anaconda3/envs/pytorch_p310/lib/python3.10/site-packages/botocore/client.py:1009, in BaseClient._make_api_call(self, operation_name, api_params) 1005 error_code = error_info.get("QueryErrorCode") or error_info.get( 1006 "Code" 1007 ) 1008 error_class = self.exceptions.from_code(error_code) -> 1009 raise error_class(parsed_response, operation_name) 1010 else: 1011 return parsed_response

ModelError: An error occurred (ModelError) when calling the InvokeEndpoint operation: Received client error (400) from primary with message "{ "code": 400, "type": "InternalServerException", "message": "Could not load model /.sagemaker/mms/models/WhereIsAI__UAE-Large-V1 with any of the following classes: (\u003cclass \u0027transformers.models.auto.modeling_auto.AutoModel\u0027\u003e, \u003cclass \u0027transformers.models.bert.modeling_bert.BertModel\u0027\u003e)." }

SeanLee97 commented 9 months ago

Hi @rajandevkota98 , It seems like it is the transfomers issue, not the model issue. Have u used the correct version?

Maybe you can ask for help in HuggingFace forum: https://discuss.huggingface.co/t/error-could-not-load-model/15362/6