Datasets:
GAIR
/

Languages:
English
ArXiv:
Tags:
License:

Issue with TypeError in GAIR/MathPile Dataset Loading

#2
by BaiXue - opened

I attempted to load the 'validation' split of the dataset with the following code:
dataset = load_dataset("GAIR/MathPile", split='validation', cache_dir=output_dir)
However, I encountered a TypeError during this process. The error message indicates a problem with casting an array of a specific structure to a different format. Here is the complete error message for your reference:

TypeError: Couldn't cast array of type
struct<char_num_after_normalized: int64, contain_at_least_two_stop_words: bool, ellipsis_line_ratio: double, idx: int64, language_detection_score: double, lines_start_with_bullet_point_ratio: double, mean_length_of_alpha_words: double, non_alphabetical_char_ratio: double, path: string, symbols_to_words_ratio: double, uppercase_word_ratio: double>
to
{'id': Value(dtype='string', id=None), 'language_detection_score': Value(dtype='float64', id=None)}

I would greatly appreciate any guidance or suggestions you could provide on resolving this issue.

BaiXue changed discussion title from TypeError: Couldn't cast array of type to Issue with TypeError in GAIR/MathPile Dataset Loading

I am getting the same error when i try to dowload the train dataset.

GAIR org

Hi, thanks for your feedback.

Currently, we recommend that you download it locally from the command line (such as huggingface-cli) instead of the python function load_dataset("GAIR/MathPile") (due to a possible network issue), unpack the gz files, and then load the jsonl files. Some commands that might be helpful are as follows

$ huggingface-cli download --resume-download --repo-type dataset GAIR/MathPile --local-dir /your/path/ --local-dir-use-symlinks False

$ cd /your/path/
$ find . -type f -name "*.gz" -exec gzip -d {} \;

Later we will also support the datasets loading via load_dataset("GAIR/MathPile"). Stay tuned.

Moreover, we have released a new version (v0.2) of MathPile. We suggest you download the latest version. We look forward to your latest feedback.

Thank you so much for taking the time to respond to my issue. Your solution was really helpful and addressed my concerns perfectly.

SinclairWang changed discussion status to closed

Hi, thanks for your feedback.

Currently, we recommend that you download it locally from the command line (such as huggingface-cli) instead of the python function load_dataset("GAIR/MathPile") (due to a possible network issue), unpack the gz files, and then load the jsonl files. Some commands that might be helpful are as follows

$ huggingface-cli download --resume-download --repo-type dataset GAIR/MathPile --local-dir /your/path/ --local-dir-use-symlinks False

$ cd /your/path/
$ find . -type f -name "*.gz" -exec gzip -d {} \;

Later we will also support the datasets loading via load_dataset("GAIR/MathPile"). Stay tuned.

Moreover, we have released a new version (v0.2) of MathPile. We suggest you download the latest version. We look forward to your latest feedback.

Does this solution mean that you have to load every jsonl file seperatly?

Sign up or log in to comment