From 086c80510ff418bca77f544d3dd4b174d2dc9c8e Mon Sep 17 00:00:00 2001 From: Alexander_Kabui Date: Mon, 2 Sep 2024 15:15:01 +0300 Subject: Remove unecessary check for open file. --- gn3/llms/process.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/gn3/llms/process.py b/gn3/llms/process.py index c3e6eda..ef925c4 100644 --- a/gn3/llms/process.py +++ b/gn3/llms/process.py @@ -94,10 +94,8 @@ def load_file(filename, dir_path): dir_path: base directory for the file Returns: json data read to a dict """ - file_path = os.path.join(dir_path, f"{filename}") - if not os.path.isfile(file_path): - raise FileNotFoundError(f"{filename} was not found or is a directory") - with open(file_path, "rb") as file_handler: + with open(os.path.join(dir_path, f"{filename}"), + "rb") as file_handler: return json.load(file_handler) -- cgit v1.2.3