Fix typos in README and bugs in RAG example code for end-to-end evaluation and finetuning
Author: yoshitomo-matsubara
Pull request: yes

# What does this PR do?

<!--
Congratulations! You've made it this far! You're not quite done yet though.

Once merged, your PR is going to appear in the release notes with the title you set, so make sure it's a great title that fully reflects the extent of your awesome contribution.

Then, please replace this with a description of the change and which issue is fixed (if applicable). Please also include relevant motivation and context. List any dependencies (if any) that are required for this change.

Once you're done, someone will review your PR shortly (see the section "Who can review?" below to tag some potential reviewers). They may suggest changes to make the code even better. If no one reviewed your PR after a week has passed, don't hesitate to post a new comment @-mentioning the same persons---sometimes notifications get lost.
-->

This PR fixes bugs in RAG example code for [end-to-end evaluation](https://github.com/huggingface/transformers/tree/master/examples/research_projects/rag#end-to-end-evaluation) and [finetuning](https://github.com/huggingface/transformers/tree/master/examples/research_projects/rag#finetuning).

## 1. Follow the file paths of reorganized examples
Also, the file paths for example code in README are updated (`example/rag/` -> `example/research_projects/rag/`)

## 2. End-to-end evaluation
```
python examples/research_projects/rag/eval_rag.py \
    --model_name_or_path facebook/rag-sequence-nq \
    --model_type rag_sequence \
    --evaluation_set path/to/dev.source \
    --gold_data_path path/to/dev.gold_data \ # parsed `biencoder-nq-dev.json` following `qa` format
    --predictions_path path/to/e2e_preds.txt \
    --eval_mode e2e \
    --gold_data_mode qa \
    --n_docs 5 \ # You can experiment with retrieving different number of documents at evaluation time
    --print_predictions \
    --recalculate
```

With the above command, I encountered a few errors:
1. an unexpected keyword argument 'clean_up_tokenization'
```
Some weights of RagSequenceForGeneration were not initialized from the model checkpoint at facebook/rag-sequence-nq and are newly initialized: ['rag.generator.lm_head.weight']
You should probably TRAIN this model on a down-stream task to be able to use it for predictions and inference.
initializing retrieval
Loading index from https://storage.googleapis.com/huggingface-nlp/datasets/wiki_dpr/
loading file https://storage.googleapis.com/huggingface-nlp/datasets/wiki_dpr/hf_bert_base.hnswSQ8_correct_phi_128.c_index.index.dpr from cache at /home/ubuntu/.cache/huggingface/transformers/a481b3aaed56325cb8901610e03e76f93b47f4284a1392d85e2ba5ce5d40d174.a382b038f1ea97c4fbad3098cd4a881a7cd4c5f73902c093e0c560511655cc0b
loading file https://storage.googleapis.com/huggingface-nlp/datasets/wiki_dpr/hf_bert_base.hnswSQ8_correct_phi_128.c_index.index_meta.dpr from cache at /home/ubuntu/.cache/huggingface/transformers/bb9560964463bc761c682818cbdb4e1662e91d25a9407afb102970f00445678c.f8cbe3240b82ffaad54506b5c13c63d26ff873d5cfabbc30eef9ad668264bab4
7it [00:00, 54.03it/s]
Traceback (most recent call last):
  File "examples/research_projects/rag/eval_rag.py", line 314, in <module>
    main(args)
  File "examples/research_projects/rag/eval_rag.py", line 300, in main
    answers = evaluate_batch_fn(args, model, questions)
  File "examples/research_projects/rag/eval_rag.py", line 134, in evaluate_batch_e2e
    print_docs=args.print_docs,
  File "/home/ubuntu/.local/share/virtualenvs/transformers-zPEj0XTF/lib/python3.7/site-packages/torch/autograd/grad_mode.py", line 26, in decorate_context
    return func(*args, **kwargs)
  File "/home/ubuntu/workspace/transformers/src/transformers/models/rag/modeling_rag.py", line 923, in generate
    **model_kwargs,
  File "/home/ubuntu/.local/share/virtualenvs/transformers-zPEj0XTF/lib/python3.7/site-packages/torch/autograd/grad_mode.py", line 26, in decorate_context
    return func(*args, **kwargs)
  File "/home/ubuntu/workspace/transformers/src/transformers/generation_utils.py", line 503, in generate
    model_kwargs = self._prepare_encoder_decoder_kwargs_for_generation(input_ids, model_kwargs)
  File "/home/ubuntu/workspace/transformers/src/transformers/generation_utils.py", line 86, in _prepare_encoder_decoder_kwargs_for_generation
    model_kwargs["encoder_outputs"]: ModelOutput = encoder(input_ids, return_dict=True, **encoder_kwargs)
  File "/home/ubuntu/.local/share/virtualenvs/transformers-zPEj0XTF/lib/python3.7/site-packages/torch/nn/modules/module.py", line 727, in _call_impl
    result = self.forward(*input, **kwargs)
TypeError: forward() got an unexpected keyword argument 'clean_up_tokenization'
```

2. another unexpected keyword argument 'print_docs'
```
Some weights of RagSequenceForGeneration were not initialized from the model checkpoint at facebook/rag-sequence-nq and are newly initialized: ['rag.generator.lm_head.weight']
You should probably TRAIN this model on a down-stream task to be able to use it for predictions and inference.
initializing retrieval
Loading index from https://storage.googleapis.com/huggingface-nlp/datasets/wiki_dpr/
loading file https://storage.googleapis.com/huggingface-nlp/datasets/wiki_dpr/hf_bert_base.hnswSQ8_correct_phi_128.c_index.index.dpr from cache at /home/ubuntu/.cache/huggingface/transformers/a481b3aaed56325cb8901610e03e76f93b47f4284a1392d85e2ba5ce5d40d174.a382b038f1ea97c4fbad3098cd4a881a7cd4c5f73902c093e0c560511655cc0b
loading file https://storage.googleapis.com/huggingface-nlp/datasets/wiki_dpr/hf_bert_base.hnswSQ8_correct_phi_128.c_index.index_meta.dpr from cache at /home/ubuntu/.cache/huggingface/transformers/bb9560964463bc761c682818cbdb4e1662e91d25a9407afb102970f00445678c.f8cbe3240b82ffaad54506b5c13c63d26ff873d5cfabbc30eef9ad668264bab4
7it [00:00, 45.43it/s]
Traceback (most recent call last):
  File "examples/research_projects/rag/eval_rag.py", line 314, in <module>
    main(args)
  File "examples/research_projects/rag/eval_rag.py", line 300, in main
    answers = evaluate_batch_fn(args, model, questions)
  File "examples/research_projects/rag/eval_rag.py", line 134, in evaluate_batch_e2e
    print_docs=args.print_docs,
  File "/home/ubuntu/.local/share/virtualenvs/transformers-zPEj0XTF/lib/python3.7/site-packages/torch/autograd/grad_mode.py", line 26, in decorate_context
    return func(*args, **kwargs)
  File "/home/ubuntu/workspace/transformers/src/transformers/models/rag/modeling_rag.py", line 923, in generate
    **model_kwargs,
  File "/home/ubuntu/.local/share/virtualenvs/transformers-zPEj0XTF/lib/python3.7/site-packages/torch/autograd/grad_mode.py", line 26, in decorate_context
    return func(*args, **kwargs)
  File "/home/ubuntu/workspace/transformers/src/transformers/generation_utils.py", line 503, in generate
    model_kwargs = self._prepare_encoder_decoder_kwargs_for_generation(input_ids, model_kwargs)
  File "/home/ubuntu/workspace/transformers/src/transformers/generation_utils.py", line 86, in _prepare_encoder_decoder_kwargs_for_generation
    model_kwargs["encoder_outputs"]: ModelOutput = encoder(input_ids, return_dict=True, **encoder_kwargs)
  File "/home/ubuntu/.local/share/virtualenvs/transformers-zPEj0XTF/lib/python3.7/site-packages/torch/nn/modules/module.py", line 727, in _call_impl
    result = self.forward(*input, **kwargs)
TypeError: forward() got an unexpected keyword argument 'print_docs'
```

## 3. Finetuning
```
python examples/research_projects/rag/finetune_rag.py \
    --data_dir $DATA_DIR \
    --output_dir $OUTPUT_DIR \
    --model_name_or_path $MODEL_NAME_OR_PATH \
    --model_type rag_sequence \
    --fp16 \
    --gpus 8
```
With the above command, I found two easy bugs to be fixed:
1. [missing `return parser`](https://github.com/huggingface/transformers/blob/8217d4e37fce48490a68af7e8ce902af16318132/examples/research_projects/rag/finetune_rag.py#L498) returns None to `parser` and crashes [here](https://github.com/huggingface/transformers/blob/8217d4e37fce48490a68af7e8ce902af16318132/examples/research_projects/rag/finetune_rag.py#L528-L531)
2. [duplicated argument with `num_retrieval_workers`](https://github.com/huggingface/transformers/blob/8217d4e37fce48490a68af7e8ce902af16318132/examples/research_projects/rag/finetune_rag.py#L490-L508) is also a blocker when using `finetune_rag.py`

## Environments
- Ubuntu 18.04 LTS
- Python 3.7.7
- transformers (I tried both 4.1.1 from pip and from repo https://github.com/huggingface/transformers/commit/912f6881d2b69f180522172a5283702bd8c41d9c)
- torch: 1.7.1

## Before submitting
- [ ] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
- [x] Did you read the [contributor guideline](https://github.com/huggingface/transformers/blob/master/CONTRIBUTING.md#start-contributing-pull-requests),
      Pull Request section?
- [ ] Was this discussed/approved via a Github issue or the [forum](https://discuss.huggingface.co/)? Please add a link
      to it if that's the case.
- [ ] Did you make sure to update the documentation with your changes? Here are the
      [documentation guidelines](https://github.com/huggingface/transformers/tree/master/docs), and
      [here are tips on formatting docstrings](https://github.com/huggingface/transformers/tree/master/docs#writing-source-documentation).
- [ ] Did you write any new necessary tests?


## Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors which may be interested in your PR.
<!-- Your PR will be replied to more quickly if you can figure out the right person to tag with @

 If you know how to use git blame, that is the easiest way, otherwise, here is a rough guide of **who to tag**.
 Please tag fewer than 3 people.

 albert, bert, XLM: @LysandreJik
 GPT2: @LysandreJik, @patrickvonplaten
 tokenizers: @mfuntowicz
 Trainer: @sgugger
 Benchmarks: @patrickvonplaten
 Model Cards: @julien-c
 examples/distillation: @VictorSanh
 nlp datasets: [different repo](https://github.com/huggingface/nlp)
 rust tokenizers: [different repo](https://github.com/huggingface/tokenizers)
 Text Generation: @patrickvonplaten, @TevenLeScao
 Blenderbot, Bart, Marian, Pegasus: @patrickvonplaten
 T5: @patrickvonplaten
 Rag: @patrickvonplaten, @lhoestq
 EncoderDecoder: @patrickvonplaten
 Longformer, Reformer: @patrickvonplaten
 TransfoXL, XLNet: @TevenLeScao, @patrickvonplaten
 examples/seq2seq: @patil-suraj
 examples/bert-loses-patience: @JetRunner
 tensorflow: @jplu
 examples/token-classification: @stefan-it
 documentation: @sgugger
 FSMT: @stas00
 -->
@patrickvonplaten @lhoestq


Comments:
Hi @patrickvonplaten,

Thank you for reviewing this PR!
As commented above, the argument `num_retrieval_workers` in `add_ray_specific_args` is duplicate ([first defined in `add_retriever_specific_args`](https://github.com/huggingface/transformers/blob/8217d4e37fce48490a68af7e8ce902af16318132/examples/research_projects/rag/finetune_rag.py#L490-L508)) and causes an error.

Great work @yoshitomo-matsubara 

Thank you for reviewing PR @patrickvonplaten @lhoestq !