Datasets:

Languages:
English
Multilinguality:
multilingual
Size Categories:
10M<n<100M
Language Creators:
crowdsourced
Annotations Creators:
no-annotation
Source Datasets:
original
ArXiv:
Tags:
text-search
License:
mariosasko commited on
Commit
7f664c1
1 Parent(s): bf2a941
Files changed (1) hide show
  1. wiki_dpr.py +17 -11
wiki_dpr.py CHANGED
@@ -166,17 +166,23 @@ class WikiDpr(datasets.ArrowBasedBuilder):
166
  def _download_post_processing_resources(self, split, resource_name, dl_manager):
167
  if resource_name == "embeddings_index":
168
  try:
169
- if not self.config.dummy:
170
- index_file = os.path.join(
171
- "data",
172
- self.config.wiki_split,
173
- self.config.embeddings_name,
174
- os.path.basename(self.config.index_file.format(split=split).split(".", 2)[-1])
175
- )
176
- downloaded_resources = dl_manager.download_and_extract(
177
- {"embeddings_index": index_file}
178
- )
179
- return downloaded_resources["embeddings_index"]
 
 
 
 
 
 
180
  except (FileNotFoundError, ConnectionError): # index doesn't exist
181
  pass
182
 
 
166
  def _download_post_processing_resources(self, split, resource_name, dl_manager):
167
  if resource_name == "embeddings_index":
168
  try:
169
+ embeddings_name = self.config.embeddings_name
170
+ if self.config.dummy:
171
+ embeddings_name = "dummy." + embeddings_name
172
+ index_file = os.path.join(
173
+ "data",
174
+ self.config.wiki_split,
175
+ self.config.embeddings_name,
176
+ (
177
+ "HNSW128_SQ8-IP-{split}.faiss"
178
+ if self.config.index_name == "exaxt"
179
+ else "IVF4096_HNSW128_PQ128-IP-{split}.faiss"
180
+ ).format(split=split)
181
+ )
182
+ downloaded_resources = dl_manager.download_and_extract(
183
+ {"embeddings_index": index_file}
184
+ )
185
+ return downloaded_resources["embeddings_index"]
186
  except (FileNotFoundError, ConnectionError): # index doesn't exist
187
  pass
188