Skip to content
This repository was archived by the owner on Mar 1, 2024. It is now read-only.

Commit 0b18058

Browse files
DilbarjotDilbarjot
andauthored
close library.json file after reading in utils. (#629)
Co-authored-by: Dilbarjot <[email protected]>
1 parent beacb50 commit 0b18058

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

llama_hub/utils.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ def import_loader(reader_str: str) -> Type[BaseReader]:
1414
"""Import or download loader."""
1515

1616
# read library json file
17-
json_dict = json.load(open(LIBRARY_JSON_PATH, "r"))
17+
with open(LIBRARY_JSON_PATH, "r") as json_file:
18+
json_dict = json.load(json_file)
19+
1820
dir_name = str(json_dict[reader_str]["id"])
1921

2022
fmt_dir_name = dir_name.replace("/", ".")

0 commit comments

Comments
 (0)