OpenBMB / OpenBMB/ModelCenter

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

Open
#44 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
270
Forks
32
PR merge metrics
No merged PRs in 30d

Description

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'

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Quick Start's step 3 dataset setup and inspect model_center/dataset/bertdataset/superglue.py, especially the BoolQ loader at the reported row["label"] access. Compare the BoolQ dataset fields with what the loader expects; done means the Google Colab Quick Start can prepare the dataset without the reported KeyError.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.