From c9be252a475f42d3d76478f34b84f2bd26141374 Mon Sep 17 00:00:00 2001 From: ignorejjj <1009979434@qq.com> Date: Mon, 11 Nov 2024 21:41:07 +0800 Subject: [PATCH] fix: use safe access for dataset_name in config --- flashrag/dataset/dataset.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flashrag/dataset/dataset.py b/flashrag/dataset/dataset.py index 5f881c4..873fd49 100644 --- a/flashrag/dataset/dataset.py +++ b/flashrag/dataset/dataset.py @@ -85,7 +85,7 @@ def __init__( ) -> None: if config is not None: self.config = config - dataset_name = config.get("dataset_name", "default_dataset") + dataset_name = config['dataset_name'] if 'dataset_name' in config else 'defalut_dataset' else: self.config = None warnings.warn("dataset_name is not in config, set it as default.")