code: def test_to_dict_with_quantization_options(self):
      component = TransformersSimilarityRanker(
          model_kwargs={
              "load_in_4bit": True,
              "bnb_4bit_use_double_quant": True,
              "bnb_4bit_quant_type": "nf4",
              "bnb_4bit_compute_dtype": torch.bfloat16,
          }
      )
      data = component.to_dict()
      assert data == {
          "type": "haystack.components.rankers.transformers_similarity.TransformersSimilarityRanker",
          "init_parameters": {
              "device": "cpu",
              "top_k": 10,
              "token": None,
              "model": "cross-encoder/ms-marco-MiniLM-L-6-v2",
              "meta_fields_to_embed": [],
              "embedding_separator": "\n",
              "scale_score": True,
              "calibration_factor": 1.0,
              "score_threshold": None,
              "model_kwargs": {
                  "load_in_4bit": True,
                  "bnb_4bit_use_double_quant": True,
                  "bnb_4bit_quant_type": "nf4",
                  "bnb_4bit_compute_dtype": "torch.bfloat16",
              },
          },
      }
  
file_path: haystack/test/components/rankers/test_transformers_similarity.py
imports: from unittest.mock import MagicMock, patch
  import pytest
  import torch
  from transformers.modeling_outputs import SequenceClassifierOutput
  from haystack import Document, ComponentError
  from haystack.components.rankers.transformers_similarity import TransformersSimilarityRanker
label_desc: Use image node_id 3 for calling the TestSimilarityRanker obj's underlying member method code with example usage: obj.test_to_dict_with_quantization_options() without return types