Closed IanMenendez closed 8 months ago
Fixed this by creating a simple custom model and mapping the inputs and outputs to the needed ones.
from transformers import BertModel
class CustomBertModel(BertModel):
def forward(self, input_dict, *args, **kwargs):
input_ids = input_dict['input_ids']
result = super().forward(input_ids, *args, **kwargs)
sentence_embedding = result[1]
return {'sentence_embedding': sentence_embedding}
What is the bug? Opensearch fails when deploying finetuned BERT models
How can one reproduce the bug? Steps to reproduce the behavior:
ZIP traced_bert.pt and tokenizer.json (get this from the finetuned model)
Upload model and deploy
Error The error message is:
What is the expected behavior? Model should be deployed
What is your host/environment?