I am fine-tuning a translation model which translates English to Swahili with my own datasets. Everything goes well during training but when I try to use the pre-trained model i run into the
following error. Any help will be highly appreciated.
If the problem is with my data please provide a step-by-step way in which I could solve it because am a beginner. Thanks
InvalidArgumentError Traceback (most recent call last)
in <cell line: 5>()
3 # Replace this with your own checkpoint
4 model_checkpoint = “KigenCHESS/new-en-to-sw”
----> 5 translaton = pipeline(“translation”, model=model_checkpoint)
/usr/local/lib/python3.9/dist-packages/transformers/models/marian/modeling_tf_marian.py in call(self, input_ids, inputs_embeds, attention_mask, head_mask, output_attentions, output_hidden_states, return_dict, training)
→ 791 inputs_embeds = self.embed_tokens(input_ids) * self.embed_scale
793 embed_pos = self.embed_positions(input_shape)
InvalidArgumentError: Exception encountered when calling layer ‘encoder’ (type TFMarianEncoder).
cannot compute Mul as input #1(zero-based) was expected to be a half tensor but is a float tensor [Op:Mul]
Call arguments received by layer ‘encoder’ (type TFMarianEncoder):
• input_ids=tf.Tensor(shape=(3, 5), dtype=int32)
• attention_mask=tf.Tensor(shape=(3, 5), dtype=int32)