    def _rope_scaling_validation(self):
        """
        Validate the `rope_scaling` configuration.
        """
        if self.rope_scaling is None:
            return

        if not isinstance(self.rope_scaling, dict) or len(self.rope_scaling) != 2:
            raise ValueError(
                '`rope_scaling` must be a dictionary with with two fields, `type` and `factor`, '
                f'got {self.rope_scaling}'
            )
        rope_scaling_type = self.rope_scaling.get('type', None)
        rope_scaling_factor = self.rope_scaling.get('factor', None)
        if rope_scaling_type is None or rope_scaling_type not in ['linear', 'dynamic']:
            raise ValueError(
                f"`rope_scaling`'s type field must be one of ['linear', 'dynamic'], got {rope_scaling_type}"
            )
        if rope_scaling_factor is None or not isinstance(rope_scaling_factor, float) or rope_scaling_factor < 1.0:
            raise ValueError(f"`rope_scaling`'s factor field must be a float >= 1, got {rope_scaling_factor}")
Validate the `rope_scaling` configuration.
projects/llava_sam2/hf/models/configuration_internlm2.py