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

Make with_format correctly indicate that a Dataset is compatible with PyTorch's Dataset class #7500

Open
benglewis opened this issue Apr 6, 2025 · 0 comments
Labels
enhancement New feature or request

Comments

@benglewis
Copy link

Feature request

Currently datasets does not correctly indicate to the Python type-checker (e.g. pyright / Pylance) that the output of with_format is compatible with PyTorch's Dataloader since it does not indicate that the HuggingFace Dataset is compatible with the PyTorch Dataset class. It would be great if we could get the typing to work nicely.

Motivation

To avoid casting types in our Python code.

Your contribution

I would be happy to contribute a PR if this is something that may be accepted and could work with the current approach.
This doesn't have to be for just PyTorch, but I imagine that the same thing would be useful for tensorflow and such, but we only have a need for PyTorch at this stage.

@benglewis benglewis added the enhancement New feature or request label Apr 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant