Skip to content

BatchEncoding Sample Input Error #124

Description

@BrandonGroth

When preparing a data sample:

def input_tiny():

# Random tokens and attention mask == 1
random_tokens = torch.randint(low=0, high=vocab_size, size=size)
attention_mask = torch.ones(size)

return BatchEncoding(
        {
            "input_ids": random_tokens,
            "attention_mask": attention_mask,
        }
    )

I get the following error in prepare_data_4_fwd() when invoking qmodel_prep():

E               TypeError: Data/dataloader provided by the user seems to have a type not in (tuple, list, or Tensor). 
E               If the data fetched from dataloader needs extra processing before being fed to model. Please consider using a `prefwdproc` function such that 
E                      model( prefwdproc(data_fetched_from_loader) )

BatchEncoding already has a lot of checks to "unpack it", so this is likely a bug.

Activity

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

Metadata

Metadata

Assignees

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