Fix the expected error in `test_offline_mode_pipeline_exception`
Author: ydshieh
Pull request: yes

# What does this PR do?

The expected error becomes `RuntimeError: You cannot infer task automatically within `pipeline` when using \noffline mode\n` since April 18, i.e. with 2 extra `\n`. It's not very clear where this change comes from, probably just the format thing from the `subprocess`.

Strangely, if I run the command in that test like below, there is no extra newline.

```bash
HF_HOME=/mnt/cache TRANSFORMERS_IS_CI=yes  TRANSFORMERS_OFFLINE=1 python3 temp.py
```
with temp.py
```python
from transformers import pipeline

mname = "hf-internal-testing/tiny-random-bert"
pipe = pipeline(model=mname)
```

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

This is extremely weird. The error is issued [here](https://github.com/huggingface/transformers/blob/9435cc6670b7b8656b33e8ff28d3bbe9bafbca9d/src/transformers/pipelines/__init__.py#L430) and is only on one line.

Yeah, but this is the log (see the last line)

-----------------------------

2023-04-26T19:08:23.5081961Z E           AssertionError: 'You cannot infer task automatically within `pipeline` when using offline mode' not found in '2023-04-26 19:07:56.056711: I tensorflow/core/platform/cpu_feature_guard.cc:193] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations:  AVX2 FMA\nTo enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.\n2023-04-26 19:07:57.005479: W tensorflow/compiler/xla/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library \'libnvinfer.so.7\'; dlerror: libnvinfer.so.7: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: /usr/local/nvidia/lib:/usr/local/nvidia/lib64\n2023-04-26 19:07:57.005598: W tensorflow/compiler/xla/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library \'libnvinfer_plugin.so.7\'; dlerror: libnvinfer_plugin.so.7: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: /usr/local/nvidia/lib:/usr/local/nvidia/lib64\n2023-04-26 19:07:57.005612: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Cannot dlopen some TensorRT libraries. If you would like to use Nvidia GPU with TensorRT, please make sure the missing libraries mentioned above are installed properly.\n╭───────────────────── Traceback (most recent call last) ──────────────────────╮\n│ <string>:11 in <module>                                                      │\n│ /transformers/src/transformers/pipelines/__init__.py:726 in pipeline         │\n│                                                                              │\n│   723 │   │   │   │   "Inferring the task automatically requires to check th │\n│   724 │   │   │   │   f"{model} is not a valid model_id."                    │\n│   725 │   │   │   )                                                          │\n│ ❱ 726 │   │   task = get_task(model, use_auth_token)                         │\n│   727 │                                                                      │\n│   728 │   # Retrieve the task                                                │\n│   729 │   if task in custom_tasks:                                           │\n│                                                                              │\n│ /transformers/src/transformers/pipelines/__init__.py:430 in get_task         │\n│                                                                              │\n│   427                                                                        │\n│   428 def get_task(model: str, use_auth_token: Optional[str] = None) -> str: │\n│   429 │   if is_offline_mode():                                              │\n│ ❱ 430 │   │   raise RuntimeError("You cannot infer task automatically within │\n│   431 │   try:                                                               │\n│   432 │   │   info = model_info(model, token=use_auth_token)                 │\n│   433 │   except Exception as e:                                             │\n╰──────────────────────────────────────────────────────────────────────────────╯\nRuntimeError: You cannot infer task automatically within `pipeline` when using \noffline mode\n'