Skip to content

fix datasets #1379

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

Merged
merged 3 commits into from
Apr 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Dockerfile.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,6 @@ RUN pip install flashtext \
pyemd \
pyupset \
pympler \
s3fs \
featuretools \
#-e git+https://github.com/SohierDane/BigQuery_Helper#egg=bq_helper \
git+https://github.com/Kaggle/learntools \
Expand Down Expand Up @@ -561,8 +560,9 @@ RUN pip install pytorch-ignite \
bqplot \
earthengine-api \
transformers \
# b/232247930 >= 2.2.0 requires pyarrow >= 6.0.0 which conflicts with dependencies for rapidsai 0.21.*
datasets==2.1.0 \
datasets \
s3fs \
gcsfs \
kaggle-environments \
geopandas \
"shapely<2" \
Expand Down
13 changes: 9 additions & 4 deletions tests/test_hf_datasets.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import unittest

from datasets import Dataset

import datasets
import pandas as pd

class TestHuggingFaceDatasets(unittest.TestCase):

Expand All @@ -10,7 +10,12 @@ def some_func(batch):
batch['label'] = 'foo'
return batch

df = Dataset.from_dict({'text': ['Kaggle rocks!']})
df = datasets.Dataset.from_dict({'text': ['Kaggle rocks!']})
mapped_df = df.map(some_func)

self.assertEqual('foo', mapped_df[0]['label'])
self.assertEqual('foo', mapped_df[0]['label'])

def test_load_dataset(self):
dataset = datasets.load_dataset("csv", data_files="/input/tests/data/train.csv")
full_data = pd.DataFrame(dataset['train'])
self.assertFalse(full_data.empty)