def max_sequence_length()

in src/exporters/coreml/config.py [0:0]


    def max_sequence_length(self) -> int:
        """
        Retrieve the max sequence length from the model configuration, or use a hardcoded value (currently 128).
        This can be subclassed to support custom lengths.
        """
        if self.infer_sequence_length_from_config:
            # Alternatives such as `n_positions` are automatically mapped to `max_position_embeddings`
            if hasattr(self._config, "max_position_embeddings"):
                return self._config.max_position_embeddings
        return 128