class_docstr: Cover the tests for model which have use_cache feature (i.e. "with_past" for ONNX)
class_docstr_tok: ["Cover","the","tests","for","model","which","have","use_cache","feature","(","i.e",".","``","with_past","''","for","ONNX",")"]
docstr: Ensure the use_past variable correctly set the `use_cache` value in model's configuration
docstr_tok: ["Ensure","the","use_past","variable","correctly","set","the","`","use_cache","`","value","in","model","'s","configuration"]
code: def test_values_override(self):
      """
      Ensure the use_past variable correctly set the `use_cache` value in model's configuration
      """
      for (
          name,
          config,
      ) in OnnxConfigWithPastTestCaseV2.SUPPORTED_WITH_PAST_CONFIGS:
          with self.subTest(name):
              # without past
              onnx_config_default = (
                  OnnxConfigWithPast.from_model_config(config())
              )
              self.assertIsNotNone(
                  onnx_config_default.values_override,
                  "values_override should not be None",
              )
              self.assertIn(
                  "use_cache",
                  onnx_config_default.values_override,
                  "use_cache should be present",
              )
              self.assertFalse(
                  onnx_config_default.values_override["use_cache"],
                  "use_cache should be False if not using past",
              )
  
              # with past
              onnx_config_default = OnnxConfigWithPast.with_past(
                  config()
              )
              self.assertIsNotNone(
                  onnx_config_default.values_override,
                  "values_override should not be None",
              )
              self.assertIn(
                  "use_cache",
                  onnx_config_default.values_override,
                  "use_cache should be present",
              )
              self.assertTrue(
                  onnx_config_default.values_override["use_cache"],
                  "use_cache should be False if not using past",
              )
  
imports: import os
  from pathlib import Path
  from tempfile import NamedTemporaryFile
  from unittest import TestCase
  from unittest.mock import patch
  import pytest
  from parameterized import parameterized
  from transformers import AutoConfig, PreTrainedTokenizerBase, is_tf_available, is_torch_available
  from transformers.onnx import EXTERNAL_DATA_FORMAT_SIZE_LIMIT, OnnxConfig, OnnxConfigWithPast, ParameterFormat, export, validate_model_outputs
  from transformers.onnx.utils import compute_effective_axis_dimension, compute_serialized_parameters_size, get_preprocessor
  from transformers.testing_utils import require_onnx, require_rjieba, require_tf, require_torch, require_vision, slow
label_desc: Use image node_id 2 for calling the OnnxConfigWithPastTestCaseV2 obj's underlying member method code with example usage: obj.test_values_override() without return types