mirror of
https://github.com/hiyouga/LLaMA-Factory.git
synced 2026-03-13 07:26:00 +08:00
[data] convert filter() to list in read_cloud_json to fix broken empty-check (#10260)
Signed-off-by: JiangNan <1394485448@qq.com>
This commit is contained in:
@@ -196,7 +196,7 @@ def read_cloud_json(cloud_path: str) -> list[Any]:
|
|||||||
|
|
||||||
# filter out non-JSON files
|
# filter out non-JSON files
|
||||||
files = [x["Key"] for x in fs.listdir(cloud_path)] if fs.isdir(cloud_path) else [cloud_path]
|
files = [x["Key"] for x in fs.listdir(cloud_path)] if fs.isdir(cloud_path) else [cloud_path]
|
||||||
files = filter(lambda file: file.endswith(".json") or file.endswith(".jsonl"), files)
|
files = list(filter(lambda file: file.endswith(".json") or file.endswith(".jsonl"), files))
|
||||||
if not files:
|
if not files:
|
||||||
raise ValueError(f"No JSON/JSONL files found in the specified path: {cloud_path}.")
|
raise ValueError(f"No JSON/JSONL files found in the specified path: {cloud_path}.")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user