Fine tuning evaluation decode problem
Currently fine tuning  a mT5 cross summarization model for english to bengali cross sum which trained on 47 language… In compute_metric function its returns the prediction in english but supposed to be in bengali.my code is here :def compute_metrics(eval_pred):predictions, labels = eval_preddecoded_preds = tokenizer.batch_decode(predictions,decoder_start_token_id=get_lang_id(target_lang), skip_special_tokens=True)# Replace -100 in the labels as we can’t decode them.labels = np.where(labels != -100, labels, tokenizer.pad_token_id)decoded_labels = tokenizer.batch_decode(labels,decoder_start_token_id=get_lang_id(target_lang), skip_special_tokens=True)# Rouge expects a newline after each sentence
decoded_preds = ["\n".join(nltk.sent_tokenize(pred.strip())) for pred in decoded_preds]
decoded_labels = ["\n".join(nltk.sent_tokenize(label.strip())) for label in decoded_labels]

print(decoded_preds)
print(decoded_labels)
result = metric.compute(predictions=decoded_preds, references=decoded_labels, use_stemmer=True)
# Extract a few results
result = {key: value.mid.fmeasure * 100 for key, value in result.items()}

# Add mean generated length
prediction_lens = [np.count_nonzero(pred != tokenizer.pad_token_id) for pred in predictions]
result["gen_len"] = np.mean(prediction_lens)

return {k: round(v, 4) for k, v in result.items()}image1531×326 29.4 KB