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)
10 frames
/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)
789 ),
790 )
â 791 inputs_embeds = self.embed_tokens(input_ids) * self.embed_scale
792
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)
⢠inputs_embeds=None
⢠attention_mask=tf.Tensor(shape=(3, 5), dtype=int32)
⢠head_mask=None
⢠output_attentions=False
⢠output_hidden_states=False
⢠return_dict=True
⢠training=False