Repository: deepset-ai/haystack

Issue:
`TransformersQueryClassifier` raises Transformers related error
**Describe the bug**
`TransformersQueryClassifier` with the default model fails on main (possible on v1.20). It's possibly related to the [latest Transformers upgrade](https://github.com/deepset-ai/haystack/commit/8342b6a45724a16c22bcdc6a9ecba6540df6ee08)

**Error message**
```bash
...
TypeError: PreTrainedTokenizerFast._batch_encode_plus() got an unexpected keyword argument 'use_auth_token'
```

**Expected behavior**
No error

**To Reproduce**
Run [Tutorial 14](https://colab.research.google.com/github/deepset-ai/haystack-tutorials/blob/main/tutorials/14_Query_Classifier.ipynb) on main using `pip install git+https://github.com/deepset-ai/haystack.git@main#egg=farm-haystack[colab,inference]` 
or 
```python
from haystack.nodes import TransformersQueryClassifier

keyword_classifier = TransformersQueryClassifier()
queries = [
    "Arya Stark father",  # Keyword Query
    "Who was the father of Arya Stark",  # Interrogative Query
    "Lord Eddard was the father of Arya Stark",  # Statement Query
]
import pandas as pd

k_vs_qs_results = {"Query": [], "Output Branch": [], "Class": []}

for query in queries:
    result = keyword_classifier.run(query=query)
    k_vs_qs_results["Query"].append(query)
    k_vs_qs_results["Output Branch"].append(result[1])
    k_vs_qs_results["Class"].append("Question/Statement" if result[1] == "output_1" else "Keyword")

pd.DataFrame.from_dict(k_vs_qs_results)
```

**FAQ Check**
- [x] Have you had a look at [our new FAQ page](https://docs.haystack.deepset.ai/docs/faq)?

**System:**
 - OS: Colab
 - GPU/CPU: GPU
 - Haystack version (commit or version number): main or 1.20
 - DocumentStore: -
 - Reader: -
 - Retriever: -



Discussion:
We should understand if this problem affects the loading of every model and in case solve it before the release.
I have tried all four models in the tutorial:
`shahrukhx01/bert-mini-finetune-question-detection` fails ❌
`shahrukhx01/question-vs-statement-classifier` fails ❌
`cardiffnlp/twitter-roberta-base-sentiment` fails ❌
`typeform/distilbert-base-uncased-mnli` works ✅ 

Resolving patch:
diff --git a/haystack/nodes/query_classifier/transformers.py b/haystack/nodes/query_classifier/transformers.py
--- a/haystack/nodes/query_classifier/transformers.py
+++ b/haystack/nodes/query_classifier/transformers.py
@@ -121,7 +121,7 @@ def __init__(
             tokenizer=tokenizer,
             device=resolved_devices[0],
             revision=model_version,
-            use_auth_token=use_auth_token,
+            token=use_auth_token,
         )
 
         self.labels = labels


Test patch:
diff --git a/test/nodes/test_query_classifier.py b/test/nodes/test_query_classifier.py
--- a/test/nodes/test_query_classifier.py
+++ b/test/nodes/test_query_classifier.py
@@ -1,3 +1,4 @@
+from unittest.mock import patch
 import pytest
 from pathlib import Path
 from urllib.error import URLError
@@ -15,6 +16,14 @@ def test_sklearnqueryclassifier_deprecation():
             pass
 
 
+@pytest.mark.unit
+def test_query_classifier_initialized_with_token_instead_of_use_auth_token():
+    with patch("haystack.nodes.query_classifier.transformers.pipeline") as mock_transformers_pipeline:
+        classifier = TransformersQueryClassifier(task="zero-shot-classification")
+        assert "token" in mock_transformers_pipeline.call_args.kwargs
+        assert "use_auth_token" not in mock_transformers_pipeline.call_args.kwargs
+
+
 @pytest.fixture
 def transformers_query_classifier():
     return TransformersQueryClassifier(