text: Title: warning bug in Qwen2DecoderLayer in transformers ==4.49
  Body: ### System Info
  
   transformers ==4.49
  
  ### Who can help?
  
  _No response_
  
  ### Information
  
  - [x] The official example scripts
  - [ ] My own modified scripts
  
  ### Tasks
  
  - [x] An officially supported task in the `examples` folder (such as GLUE/SQuAD, ...)
  - [ ] My own task or dataset (give details below)
  
  ### Reproduction
  
  `class Qwen2DecoderLayer(nn.Module):
      def __init__(self, config: Qwen2Config, layer_idx: int):
          super().__init__()
          self.hidden_size = config.hidden_size
          self.self_attn = Qwen2Attention(config=config, layer_idx=layer_idx)
          self.mlp = Qwen2MLP(config)
          self.input_layernorm = Qwen2RMSNorm(config.hidden_size, eps=config.rms_norm_eps)
          self.post_attention_layernorm = Qwen2RMSNorm(config.hidden_size, eps=config.rms_norm_eps)
          if config.sliding_window and config._attn_implementation != "flash_attention_2":
              logger.warning_once(
                  f"Sliding Window Attention is enabled but not implemented for `{config._attn_implementation}`; "
                  "unexpected results may be encountered."
              )
  `
  config.sliding_window is a number , the warning active 100%
  the code should be config.use_sliding_window ?
  
  
  ### Expected behavior
  
  `class Qwen2DecoderLayer(nn.Module):
      def __init__(self, config: Qwen2Config, layer_idx: int):
          super().__init__()
          self.hidden_size = config.hidden_size
          self.self_attn = Qwen2Attention(config=config, layer_idx=layer_idx)
          self.mlp = Qwen2MLP(config)
          self.input_layernorm = Qwen2RMSNorm(config.hidden_size, eps=config.rms_norm_eps)
          self.post_attention_layernorm = Qwen2RMSNorm(config.hidden_size, eps=config.rms_norm_eps)
          if config.sliding_window and config._attn_implementation != "flash_attention_2":
              logger.warning_once(
                  f"Sliding Window Attention is enabled but not implemented for `{config._attn_implementation}`; "
                  "unexpected results may be encountered."
              )
  `
  config.sliding_window is a number , the warning active 100%
  the code should be config.use_sliding_window ?
  