Skip to content

IndexError: tuple index out of range in input_ids during pre-training #199

Description

@ebrarkiziloglu

Following the instructions in the README, I am working on pre-training from scratch. I ran training with the composer framework using the yamls/main/flex-bert-base.yaml config and with the c4 dataset ./my-copy-c4.
[note that I verified that the dataloader works fine following the instructions.]

However, I encountered the following error during training:

IndexError: tuple index out of range

  File "/.../ModernBERT/src/bert_layers/embeddings.py", line 153, in forward
    position_ids = self.position_ids[:, 0 : input_ids.shape[1]]
                                            ~~~~~~~~~~~~~~~^^^

Steps to Reproduce

  1. Prepare the c4 dataset.
  2. Set up the conda environment per instructions.
  3. Run training with composer main.py yamls/main/flex-bert-base.yaml
  4. The error occurs during training in bert_layers/embeddings.py

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions