Hello @sgugger, thank you very much for your response 
I have put strip() when loading predictions and references back (as below) which should have the same effect as to pass them through post_process() before writing to file.
predictions.append(sentence.strip())
references.append(sentence.strip())

There is one thing I felt confused I would like to bring up. The way compute_metrics() handles references is different from the way native sacrebleu.corpus_bleu() does. (I have one reference sentence per prediction sentence.) compute_metrics() takes references in a format of [[ref1], [ref2], [ref3],…]; while sacrebleu.corpus_bleu() takes references in a format of [[ref1, ref2, ref3]]. I thought this is the why they gave different bleu score. However, when I took a look at the source code of datasets/metrics/sacrebleu/sacrebleu.py, I think, after transformation, they are both in the format of [[ref1, ref2, ref3]] when feeding into sacrebleu.corpus_bleu().
references_per_prediction = len(references[0])
transformed_references = [[refs[i] for refs in references] for i in range(references_per_prediction)]


  

      github.com
  

  
    huggingface/datasets/blob/67574a8d74796bc065a8b9b49ec02f7b1200c172/metrics/sacrebleu/sacrebleu.py#L116-L119



      
      
          references_per_prediction = len(references[0])
          if any(len(refs) != references_per_prediction for refs in references):
              raise ValueError("Sacrebleu requires the same number of references for each prediction")
          transformed_references = [[refs[i] for refs in references] for i in range(references_per_prediction)]
      
    
  


  

  
    
    
  

  


Now I am confused again and have to continue trying to find where this inconsistency is from…
Please let me know if you have any thoughts. Thank you very much once again!