Make with_format
correctly indicate that a Dataset
is compatible with PyTorch's Dataset
class
#7500
Labels
enhancement
New feature or request
Feature request
Currently
datasets
does not correctly indicate to the Python type-checker (e.g.pyright
/Pylance
) that the output ofwith_format
is compatible with PyTorch'sDataloader
since it does not indicate that the HuggingFaceDataset
is compatible with the PyTorchDataset
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.The text was updated successfully, but these errors were encountered: