Saving prediction for --do_predict and --predict_with_generate in  transormers/examples/pytorch/question-answering /run_seq2seq_qa.py
### Feature request

The feature for saving predictions for `--do_predict` and `--predict_with_generate` was not functional for `run_seq2seq_qa.py` module.
Missing code file -> `transformers/examples/pytorch/question-answering/trainer_seq2seq_qa.py`
Image of the section of code which should handle this.
![hugging_face error1](https://user-images.githubusercontent.com/47103482/234679772-efecc017-8efa-445d-a55f-04b6b6ef0732.png)


### Motivation

Some other modules like run_summarization.py have that feature.
Motivation from `transformers/examples/pytorch/summarization/run_summarization.py`
![hugging_face error2](https://user-images.githubusercontent.com/47103482/234680113-5cbb7030-99e3-428a-adbd-b171088237c0.png)


### Your contribution

Adding a code snippet would help to save the predictions for `--do_predict` and `--predict_with_generate`.
Code changes to be done here -> `transformers/examples/pytorch/question-answering/trainer_seq2seq_qa.py`
```python
   # Prediction
    if training_args.do_predict:
        logger.info("*** Predict ***")
        results = trainer.predict(predict_dataset, predict_examples)
        metrics = results.metrics

        max_predict_samples = (
            data_args.max_predict_samples if data_args.max_predict_samples is not None else len(predict_dataset)
        )
        metrics["predict_samples"] = min(max_predict_samples, len(predict_dataset))

        trainer.log_metrics("predict", metrics)
        trainer.save_metrics("predict", metrics)
        
        # Added code section for saving predictions
        if trainer.is_world_process_zero():
            if training_args.predict_with_generate:
                predictions = predict_results.predictions
                predictions = [pred['prediction_text'] for pred in predictions]
                output_prediction_file = os.path.join(training_args.output_dir, "generated_predictions.txt")
                with open(output_prediction_file, "w") as writer:
                    writer.write("\n".join(predictions))

``` 
![hugging_face error](https://user-images.githubusercontent.com/47103482/234679511-45055aba-c21b-45b3-bc66-02cbd68711d5.png)

Do you want to open a PR with those changes?<|||||>Yeah Sure I can do that.<|||||>This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the [contributing guidelines](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md) are likely to be ignored.