How to run the onnx of nllb?

#25
by 9999tt - opened

My encoder runs well I think, but the decoder keep giving me the same output no matter what I give to it.
Model I used:
encoder_model.onnx
decoder_model.onnx

The code of decoder run session is :
outputs = decoder_session.run(
['logits', 'present.0.decoder.key', 'present.0.decoder.value'], # logits
{
'encoder_attention_mask':attention_mask.astype(np.int64),
'input_ids': decoder_input_ids.astype(np.int64), # Decoder
'encoder_hidden_states': encoder_hidden_states, # Encoder
}
)

anyone could help? Thank you!

And I don't konw how or where to set the src_lang and tgt_lang here, please give some hints, thanks!

Sign up or log in to comment