[Pipeline] avoid importing tensorflow if not used
# What does this PR do?

Avoids loading unnecessary modules by `pipelines.base.infer_framework_load_model()` which could create some unexpected behaviour like tensorflow allocating all GPU memory.
@sgugger @LysandreJik 

Before:
```python
from transformers import pipeline
pipeline("text-classification")
# This would try importing `TFDistilBertForSequenceClassification`if both tensorflow and pytorch
# are available, and tensorflow would allocate all GPU memory, even if we expect to use
# the pytorch model
```

After:

```python
from transformers import pipeline
pipeline("text-classification")
# Only `DistilBertForSequenceClassification` is imported, and tensorflow is not called
```

_The documentation is not available anymore as the PR was closed or merged._<|||||>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.<|||||>Was this issue resolved in another PR already? @sgugger <|||||>The fact that TensorFlow takes all GPU memory has been fixed in #18044