Skip to content

Commit

Permalink
Ensure cache folder is created
Browse files Browse the repository at this point in the history
  • Loading branch information
HishamAlyahya committed Feb 2, 2024
1 parent 56fbc19 commit 965f86d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ from pyllm import CodeLLM
llm = CodeLLM()
swap_numbers = llm.def_function(
"Swap two input numbers", unit_tests=[((1, 2), (2, 1))], use_cached=False
"Swap two input numbers", unit_tests=[((1, 2), (2, 1))]
)
print(swap_numbers(20, 40))
# Output: (40, 20)
Expand Down
3 changes: 3 additions & 0 deletions pyllm/llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
from pyllm.exceptions import TooManyRetries


os.makedirs(user_cache_dir("PyLLM"), exist_ok=True)


class CacheHandler:
CACHE_FILE = os.path.join(user_cache_dir("PyLLM"), "cached_functions.json")

Expand Down

0 comments on commit 965f86d

Please sign in to comment.