Writing predictions in a separate output file
## 🚀 Feature

 Request for providing the final predictions (and probabilities of each class for classification task) on the validation/test set in a separate .txt or .json file  

## Motivation

 Since many of us will be using the provided models (RoBERTa, XLnet, BERT etc.) on various other NLP tasks and we will be probably using custom evaluation functions for different tasks, it would be very helpful if the final output predictions on val/test set cab be written in a separate .txt or .json output file. For example, the original BERT tensorflow codes (https://github.com/google-research/bert) writes the final predictions of GLUE tasks in an output file "eval_results.txt" and "predictions.json" for SQuAD. 

## Additional context

I have printed the predictions from the function "evaluate(args, model, tokenizer, prefix="")" in line 189 of run_glue.py but I found the sequence of predictions is not the same as the input validation file. I will hopefully resort the original sequence of predictions in run_glue.py but I think I might have to do more than this in reading comprehension model predictions for SQuAD. I feel many of the users would be looking for this feature and it might help many others if everyone doesnt have to edit evaluate functions on their own individually. 
Looking forward for your kind response and thanks for the help. 
Solved it, apologies for raising this silly request.<|||||>Hi, how did u solve this?<|||||>Hi, I would like to know how can I do it. Thanks<|||||>You can access to label predictions thanks to the variable "preds" (line 318 after squeeze function). You can save it in a text file in a similar way of the line 323.