From a51b8ec620e52cbfcad91d12f0acd7c73f448444 Mon Sep 17 00:00:00 2001 From: hiyouga Date: Fri, 1 Dec 2023 17:04:37 +0800 Subject: [PATCH] add err hint --- .gitignore | 1 - src/llmtuner/webui/common.py | 6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 47762394..0355c666 100644 --- a/.gitignore +++ b/.gitignore @@ -157,7 +157,6 @@ cython_debug/ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore # and can be added to the global gitignore or merged into this file. For a more nuclear # option (not recommended) you can uncomment the following to ignore the entire idea folder. -# The ".idea" folder can generally be ignored directly. .idea/ # custom .gitignore diff --git a/src/llmtuner/webui/common.py b/src/llmtuner/webui/common.py index 55d8942b..8788754a 100644 --- a/src/llmtuner/webui/common.py +++ b/src/llmtuner/webui/common.py @@ -89,12 +89,12 @@ def list_checkpoint(model_name: str, finetuning_type: str) -> Dict[str, Any]: return gr.update(value=[], choices=checkpoints) -def load_dataset_info(dataset_dir: str) -> Dict[str, Any]: +def load_dataset_info(dataset_dir: str) -> Dict[str, Dict[str, Any]]: try: with open(os.path.join(dataset_dir, DATA_CONFIG), "r", encoding="utf-8") as f: return json.load(f) - except: - print("Cannot find {} in {}.".format(DATA_CONFIG, dataset_dir)) + except Exception as err: + print("Cannot open {} in {} due to {}.".format(DATA_CONFIG, dataset_dir, str(err))) return {}