Path OS compatibility fix
Browse filesHello!
I found the way the path was handled didn't work in my Windows environment. The reason is that the paths in Windows use "\" instead of "/". I suggest this change to make the code cross-platform compatible. It uses the "parts" attribute of the path, so it is independent of the OS used.
Cheers!
gtzan.py
CHANGED
@@ -80,8 +80,8 @@ class Gtzan(datasets.GeneratorBasedBuilder):
|
|
80 |
data = []
|
81 |
|
82 |
for path in paths:
|
83 |
-
label =
|
84 |
-
name =
|
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 |
|