make run_generation more generic for other devices
## What does this PR do?
Currently, the example for text-generation is only available for cuda or cpu. This PR makes it work well on mps or npu devices.

Verified on A100 and npu.

Example usage:
```
python3 run_generation.py \
    --model_type=gpt2 \
    --model_name_or_path=gpt2
```

Below are the output logs:
- On GPU
  ```
  07/27/2023 11:23:51 - WARNING - __main__ - device: cuda, n_gpu: 8, 16-bits training: False
  Using pad_token, but it is not set yet.
  07/27/2023 11:23:57 - INFO - __main__ - Namespace(model_type='gpt2', model_name_or_path='gpt2', prompt='', length=20, stop_token=None, temperature=1.0, repetition_penalty=1.0, k=0, p=0.9, prefix='', padding_text='', xlm_language='', seed=42, use_cpu=False, num_return_sequences=1, fp16=False, jit=False, device=device(type='cuda'), n_gpu=8)
  Model prompt >>> "I'm Jack
  The attention mask and the pad token id were not set. As a consequence, you may observe unexpected behavior. Please pass your input's `attention_mask` to obtain reliable results.
  Setting `pad_token_id` to `eos_token_id`:50256 for open-end generation.
  === GENERATED SEQUENCE 1 ===
  "I'm Jack Russell."
  
  "They said, 'Hey, you know, you have to get away with
  ```

- On NPU：
  ```
  07/27/2023 11:21:47 - WARNING - __main__ - device: npu, n_gpu: 8, 16-bits training: False
  Using pad_token, but it is not set yet.
  07/27/2023 11:22:03 - INFO - __main__ - Namespace(device=device(type='npu'), fp16=False, jit=False, k=0, length=20, model_name_or_path='gpt2', model_type='gpt2', n_gpu=8, num_return_sequences=1, p=0.9, padding_text='', prefix='', prompt='', repetition_penalty=1.0, seed=42, stop_token=None, temperature=1.0, use_cpu=False, xlm_language='')
  Model prompt >>> "I'm Jack
  The attention mask and the pad token id were not set. As a consequence, you may observe unexpected behavior. Please pass your input's `attention_mask` to obtain reliable results.
  Setting `pad_token_id` to `eos_token_id`:50256 for open-end generation.
  === GENERATED SEQUENCE 1 ===
  "I'm Jack Dylan," guitarist Tim Farrell said, picking up Dylan's Lave Club guitar and in a playful styl
  ```



_The documentation is not available anymore as the PR was closed or merged._