Datasets:
fix path
Browse files
Teyvat.py
CHANGED
@@ -92,12 +92,13 @@ class Teyvat(datasets.GeneratorBasedBuilder):
|
|
92 |
name=datasets.Split.TRAIN,
|
93 |
# These kwargs will be passed to _generate_examples
|
94 |
gen_kwargs={
|
|
|
95 |
"meta_data_path": meta_data_path
|
96 |
},
|
97 |
),
|
98 |
]
|
99 |
|
100 |
-
def _generate_examples(self, meta_data_path):
|
101 |
# This method handles input defined in _split_generators to yield
|
102 |
# (key, example) tuples from the dataset.
|
103 |
# The `key` is for legacy reasons (tfds) and is not important in itself,
|
@@ -108,7 +109,7 @@ class Teyvat(datasets.GeneratorBasedBuilder):
|
|
108 |
data = load(open(meta_data_path, "r", encoding="utf8"))
|
109 |
|
110 |
for image in data:
|
111 |
-
image_path =
|
112 |
text = image["text"]
|
113 |
|
114 |
|
|
|
92 |
name=datasets.Split.TRAIN,
|
93 |
# These kwargs will be passed to _generate_examples
|
94 |
gen_kwargs={
|
95 |
+
"data_path": data_path
|
96 |
"meta_data_path": meta_data_path
|
97 |
},
|
98 |
),
|
99 |
]
|
100 |
|
101 |
+
def _generate_examples(self, data_path, meta_data_path):
|
102 |
# This method handles input defined in _split_generators to yield
|
103 |
# (key, example) tuples from the dataset.
|
104 |
# The `key` is for legacy reasons (tfds) and is not important in itself,
|
|
|
109 |
data = load(open(meta_data_path, "r", encoding="utf8"))
|
110 |
|
111 |
for image in data:
|
112 |
+
image_path = data_path + image["file_name"]
|
113 |
text = image["text"]
|
114 |
|
115 |
|