Datasets:
Update files from the datasets library (from 1.16.0)
Browse filesRelease notes: https://github.com/huggingface/datasets/releases/tag/1.16.0
- wiki_dpr.py +2 -2
wiki_dpr.py
CHANGED
@@ -154,12 +154,12 @@ class WikiDpr(datasets.GeneratorBasedBuilder):
|
|
154 |
if self.config.with_embeddings:
|
155 |
if vec_idx >= len(vecs):
|
156 |
if len(vectors_files) == 0:
|
157 |
-
logger.warning("Ran out of vector files at index {}"
|
158 |
break
|
159 |
vecs = np.load(open(vectors_files.pop(0), "rb"), allow_pickle=True)
|
160 |
vec_idx = 0
|
161 |
vec_id, vec = vecs[vec_idx]
|
162 |
-
assert int(id) == int(vec_id), "ID mismatch between lines {} and vector {}"
|
163 |
yield id, {"id": id, "text": text, "title": title, "embeddings": vec}
|
164 |
vec_idx += 1
|
165 |
else:
|
|
|
154 |
if self.config.with_embeddings:
|
155 |
if vec_idx >= len(vecs):
|
156 |
if len(vectors_files) == 0:
|
157 |
+
logger.warning(f"Ran out of vector files at index {i}")
|
158 |
break
|
159 |
vecs = np.load(open(vectors_files.pop(0), "rb"), allow_pickle=True)
|
160 |
vec_idx = 0
|
161 |
vec_id, vec = vecs[vec_idx]
|
162 |
+
assert int(id) == int(vec_id), f"ID mismatch between lines {id} and vector {vec_id}"
|
163 |
yield id, {"id": id, "text": text, "title": title, "embeddings": vec}
|
164 |
vec_idx += 1
|
165 |
else:
|