albertvillanova HF staff commited on
Commit
784a4da
1 Parent(s): b7c327e

Pass file object instead of non-supported URL string to np.load

Browse files
Files changed (1) hide show
  1. fashion_mnist_corrupted.py +4 -2
fashion_mnist_corrupted.py CHANGED
@@ -117,8 +117,10 @@ class FashionMnistCorrupted(datasets.GeneratorBasedBuilder):
117
  def _generate_examples(self, filepath, split):
118
  """This function returns the examples in the raw form."""
119
  # Images
120
- images = np.load(filepath[0])
121
- labels = np.load(filepath[1])
 
 
122
 
123
  if images.shape[0] != labels.shape[0]:
124
  raise ValueError(
 
117
  def _generate_examples(self, filepath, split):
118
  """This function returns the examples in the raw form."""
119
  # Images
120
+ with open(filepath[0], "rb") as f:
121
+ images = np.load(f)
122
+ with open(filepath[1], "rb") as f:
123
+ labels = np.load(f)
124
 
125
  if images.shape[0] != labels.shape[0]:
126
  raise ValueError(