Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Following Quick Start and in step 3 "Prepare the dataset" encountering "KeyError: 'label'" #44

Open
jiangzizi opened this issue Feb 29, 2024 · 0 comments

Comments

@jiangzizi
Copy link

jiangzizi commented Feb 29, 2024

I followed the Quick Start and in step 3, when I copied the code to Google Colab and try to run it, I encountered "KeyError: 'label'". I found that there were not key 'label' in BoolQ dataset, and try to directly change the package file, but did not work.


KeyError Traceback (most recent call last)
in <cell line: 9>()
8
9 for split in splits:
---> 10 dataset[split] = DATASET['BoolQ']('/content/drive/MyDrive', split, bmt.rank(), bmt.world_size(), tokenizer, max_encoder_length=512)
11
12 batch_size = 64

/usr/local/lib/python3.10/dist-packages/model_center/dataset/bertdataset/superglue.py in init(self, path, split, rank, world_size, tokenizer, max_encoder_length)
90 from tqdm import tqdm
91 for row in self.read_data("BoolQ", path, split, rank, world_size):
---> 92 label = 1 if row["label"]==True else 0
93 text_a = row['passage']
94 text_b = row['question']

KeyError: 'label'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant