andreaschandra commited on
Commit
304eebe
1 Parent(s): b488a0e

update file

Browse files
Files changed (1) hide show
  1. causalqa.py +4 -6
causalqa.py CHANGED
@@ -58,7 +58,6 @@ class CausalQA(datasets.GeneratorBasedBuilder):
58
  http = urllib3.PoolManager()
59
 
60
  _PATH_METADATA_RES = http.request('GET', 'https://huggingface.co/datasets/jakartaresearch/causalqa/raw/main/source/features_metadata.yaml')
61
- _PATH_METADATA = json.loads(_PATH_METADATA_RES.data.decode("utf-8"))
62
  _FILE_URL_RES = http.request('GET', 'https://huggingface.co/datasets/jakartaresearch/causalqa/raw/main/source/dataset_info.json')
63
  _FILE_URL = json.loads(_FILE_URL_RES.data.decode("utf-8"))
64
  _PATH_DESCRIPTION_RES = http.request('GET', 'https://huggingface.co/datasets/jakartaresearch/causalqa/raw/main/source/dataset_description.txt')
@@ -67,11 +66,10 @@ class CausalQA(datasets.GeneratorBasedBuilder):
67
  _HOMEPAGE = _FILE_URL['homepage']
68
  all_files = _FILE_URL['files']
69
 
70
- with open(_PATH_METADATA, "r") as stream:
71
- try:
72
- fmeta = yaml.safe_load(stream)
73
- except yaml.YAMLError as exc:
74
- print(exc)
75
 
76
  BUILDER_CONFIGS = []
77
  for f in all_files:
 
58
  http = urllib3.PoolManager()
59
 
60
  _PATH_METADATA_RES = http.request('GET', 'https://huggingface.co/datasets/jakartaresearch/causalqa/raw/main/source/features_metadata.yaml')
 
61
  _FILE_URL_RES = http.request('GET', 'https://huggingface.co/datasets/jakartaresearch/causalqa/raw/main/source/dataset_info.json')
62
  _FILE_URL = json.loads(_FILE_URL_RES.data.decode("utf-8"))
63
  _PATH_DESCRIPTION_RES = http.request('GET', 'https://huggingface.co/datasets/jakartaresearch/causalqa/raw/main/source/dataset_description.txt')
 
66
  _HOMEPAGE = _FILE_URL['homepage']
67
  all_files = _FILE_URL['files']
68
 
69
+ try:
70
+ fmeta = yaml.safe_load(_PATH_METADATA_RES.data)
71
+ except yaml.YAMLError as exc:
72
+ print(exc)
 
73
 
74
  BUILDER_CONFIGS = []
75
  for f in all_files: