def _create_new_shard_file(self):
        """Create a new shard file and return the H5 file object."""
        new_shard_path = (
            f"{self.base_name}_{self.current_shard_index:05}.weights.h5"
        )
        self.current_shard_index += 1
        self.current_shard_path = self.path.with_name(new_shard_path)
        h5_file = self._get_h5_file(self.current_shard_path)
        self.current_shard_filenames.append(pathlib.Path(h5_file.filename).name)
        self._h5_entry_initialized = False
        return h5_file
Create a new shard file and return the H5 file object.
keras/src/saving/saving_lib.py