Datasets:

Path OS compatibility fix

#1
by mcamara - opened
Files changed (1) hide show
  1. gtzan.py +2 -2
gtzan.py CHANGED
@@ -80,8 +80,8 @@ class Gtzan(datasets.GeneratorBasedBuilder):
80
  data = []
81
 
82
  for path in paths:
83
- label = str(path).split("/")[-2]
84
- name = str(path).split("/")[-1]
85
  if name in CORRUPTED_FILES:
86
  continue
87
 
 
80
  data = []
81
 
82
  for path in paths:
83
+ label = path.parts[-2]
84
+ name = path.parts[-1]
85
  if name in CORRUPTED_FILES:
86
  continue
87