umwyf commited on
Commit
6f6e871
1 Parent(s): 4d68c90

Upload Hi-ToM.py

Browse files

New Loading Script

Files changed (1) hide show
  1. Hi-ToM.py +9 -3
Hi-ToM.py CHANGED
@@ -1,10 +1,14 @@
 
1
  from datasets import DatasetBuilder, DatasetInfo, SplitGenerators, DownloadManager
2
- from datasets.features import Features, ClassLabel, Sequence, Value
 
3
 
4
  class MyCustomDataset(DatasetBuilder):
5
  VERSION = datasets.Version("1.0.0")
6
 
7
  def _info(self):
 
 
8
  return DatasetInfo(
9
  description="My custom dataset for tracking objects.",
10
  features=Features({
@@ -20,12 +24,12 @@ class MyCustomDataset(DatasetBuilder):
20
  }),
21
  supervised_keys=None,
22
  homepage="https://github.com/ying-hui-he/Hi-ToM_dataset",
23
- citation=CITATION,
24
  )
25
 
26
  def _split_generators(self, dl_manager: DownloadManager):
 
27
  downloaded_files = dl_manager.download_and_extract({
28
- "data_file": "https://huggingface.co/datasets/Hi-ToM/Hi-ToM_Dataset/blob/main/Hi-ToM_data.json"
29
  })
30
 
31
  return [
@@ -52,3 +56,5 @@ class MyCustomDataset(DatasetBuilder):
52
  "choices": item["choices"],
53
  "answer": item["answer"],
54
  }
 
 
 
1
+ import json
2
  from datasets import DatasetBuilder, DatasetInfo, SplitGenerators, DownloadManager
3
+ from datasets.features import Features, Value
4
+ import datasets
5
 
6
  class MyCustomDataset(DatasetBuilder):
7
  VERSION = datasets.Version("1.0.0")
8
 
9
  def _info(self):
10
+ # Ensure CITATION is a string containing the bibliographic citation for your dataset
11
+
12
  return DatasetInfo(
13
  description="My custom dataset for tracking objects.",
14
  features=Features({
 
24
  }),
25
  supervised_keys=None,
26
  homepage="https://github.com/ying-hui-he/Hi-ToM_dataset",
 
27
  )
28
 
29
  def _split_generators(self, dl_manager: DownloadManager):
30
+ # Using the raw content URL for GitHub
31
  downloaded_files = dl_manager.download_and_extract({
32
+ "data_file": "https://raw.githubusercontent.com/ying-hui-he/Hi-ToM_dataset/main/Hi-ToM_data.json"
33
  })
34
 
35
  return [
 
56
  "choices": item["choices"],
57
  "answer": item["answer"],
58
  }
59
+
60
+ # Replace 'MyCustomDataset' with a suitable name that follows Python class naming conventions.