lhoestq HF staff commited on
Commit
c38f2c6
1 Parent(s): 39f34ba

fix preview

Browse files
Files changed (1) hide show
  1. wikipedia.py +5 -5
wikipedia.py CHANGED
@@ -470,8 +470,8 @@ class Wikipedia(datasets.ArrowBasedBuilder):
470
  """This function returns the examples in the raw (text) form."""
471
  logger.info("generating examples from = %s", filepath)
472
 
473
- pf = pq.ParquetFile(filepath)
474
-
475
- for group_i in range(pf.num_row_groups):
476
- tbl = pf.read_row_group(group_i)
477
- yield group_i, tbl
 
470
  """This function returns the examples in the raw (text) form."""
471
  logger.info("generating examples from = %s", filepath)
472
 
473
+ with open(filepath, "rb") as f:
474
+ pf = pq.ParquetFile(filepath)
475
+ for group_i in range(pf.num_row_groups):
476
+ tbl = pf.read_row_group(group_i)
477
+ yield group_i, tbl