Skip to content

Conversation

Wing1es
Copy link

@Wing1es Wing1es commented Aug 21, 2025

The use of set_format("torch") on Hugging Face datasets can sometimes result in a TypeError: 'NoneType' object is not callable because set_format mutates the dataset in place and may return None. A safer alternative is to use with_format("torch"), which creates a formatted view of the dataset without mutating the original, preventing this error.

…oneType errors 4.mdx

The use of set_format("torch") on Hugging Face datasets can sometimes result in a TypeError: 'NoneType' object is not callable because set_format mutates the dataset in place and may return None. A safer alternative is to use with_format("torch"), which creates a formatted view of the dataset without mutating the original, preventing this error.
@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

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.

2 participants