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

Loading local datasets with split=‘test’ #65

Open
yichen0104 opened this issue May 30, 2024 · 1 comment
Open

Loading local datasets with split=‘test’ #65

yichen0104 opened this issue May 30, 2024 · 1 comment

Comments

@yichen0104
Copy link

I’m trying to evaluate a new model with LongBench and would like to load the datasets stored locally (downloaded and unzipped directly from HuggingFace). But whenever I’m reading the data with flag split=‘test’ in pred.py (say we are reading xxx.jsonl within the loop, the line is modded as data = load_dataset("json", data_files="/some/dir/xxx.jsonl", split="test") ), it will return a ValurError: Unknown split “test”. Should be one of [‘train’]. Is there any pre-processing I should perform on the downloaded data? Thanks in advance.

@bys0318
Copy link
Member

bys0318 commented Jun 4, 2024

If you have downloaded the dataset files locally, you can load them via:

data = [json.loads(line) for line in open("/some/dir/xxx.jsonl", "r", encoding="utf-8")]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants