mirror of
https://kkgithub.com/chinese-poetry/chinese-poetry.git
synced 2026-06-20 11:48:33 +00:00
Handle loader datasets without excludes
This commit is contained in:
@@ -31,9 +31,10 @@ class PlainDataLoader():
|
|||||||
body += poem[tag]
|
body += poem[tag]
|
||||||
return body
|
return body
|
||||||
# a dir, probably with a skip list
|
# a dir, probably with a skip list
|
||||||
subpaths = os.listdir(full_path)
|
excludes = set(configs.get("excludes", []))
|
||||||
|
subpaths = sorted(os.listdir(full_path))
|
||||||
for filename in subpaths:
|
for filename in subpaths:
|
||||||
if filename in configs["excludes"]:
|
if filename in excludes:
|
||||||
continue
|
continue
|
||||||
with open(os.path.join(full_path, filename), mode='r', encoding='utf-8') as file:
|
with open(os.path.join(full_path, filename), mode='r', encoding='utf-8') as file:
|
||||||
data = json.load(file)
|
data = json.load(file)
|
||||||
|
|||||||
Reference in New Issue
Block a user