Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Incorrect access of dataset field fixed#41631

Open
vignesh1507 wants to merge 1 commit into
huggingface:mainfrom
vignesh1507:patch-1
Open

Incorrect access of dataset field fixed#41631
vignesh1507 wants to merge 1 commit into
huggingface:mainfrom
vignesh1507:patch-1

Conversation

@vignesh1507

Copy link
Copy Markdown

In test_tokenizer:

`for text in dataset[i]["premise"].values():
test_string(slow, fast, text)

hypothesis, all languages

for text in dataset[i]["hypothesis"]["translation"]:
test_string(slow, fast, text)`

The "premise" field in the XNLI dataset is a string, not a dictionary**. Calling .values() on a string will raise an error. Similarly, "hypothesis" is also a string (not a dictionary), so "hypothesis"]["translation" will fail.

In `test_tokenizer`:

`for text in dataset[i]["premise"].values():
    test_string(slow, fast, text)

# hypothesis, all languages
for text in dataset[i]["hypothesis"]["translation"]:
    test_string(slow, fast, text)`

The "premise" field in the XNLI dataset is a string, not a dictionary**. Calling .values() on a string will raise an error.
Similarly, "hypothesis" is also a string (not a dictionary), so "hypothesis"]["translation" will fail.
@Rocketknight1

Copy link
Copy Markdown
Member

cc @ydshieh do you know if this script is still in use?

@ydshieh

ydshieh commented Oct 16, 2025

Copy link
Copy Markdown
Collaborator

@Rocketknight1

Can't find any usage in the codebase. The recent changes in the history are more about type hints. Let's remove it.

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

Successfully merging this pull request may close these issues.

3 participants