Skip to content

Instantly share code, notes, and snippets.

@jph00
Created October 5, 2022 02:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jph00/75cc2213e9488435d44efad9fa13caab to your computer and use it in GitHub Desktop.
Save jph00/75cc2213e9488435d44efad9fa13caab to your computer and use it in GitHub Desktop.
Example of using `prepare_for_task` in Hugging Face Datasets
from datasets.tasks import ImageClassification
t = train.rename_columns({'image':'a', 'label':'b'})
t2 = t.prepare_for_task(ImageClassification(image_column='a', label_column='b'))
t2.features
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment