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

Commit

Permalink
close library.json file after reading in utils. (#629)
Browse files Browse the repository at this point in the history
Co-authored-by: Dilbarjot <dilbarjot@syntax.com>
  • Loading branch information
Dilbarjot and Dilbarjot authored Nov 13, 2023
1 parent beacb50 commit 0b18058
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion llama_hub/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ def import_loader(reader_str: str) -> Type[BaseReader]:
"""Import or download loader."""

# read library json file
json_dict = json.load(open(LIBRARY_JSON_PATH, "r"))
with open(LIBRARY_JSON_PATH, "r") as json_file:
json_dict = json.load(json_file)

dir_name = str(json_dict[reader_str]["id"])

fmt_dir_name = dir_name.replace("/", ".")
Expand Down

0 comments on commit 0b18058

Please sign in to comment.