Skip to content

Commit

Permalink
Refactor to docetl
Browse files Browse the repository at this point in the history
  • Loading branch information
shreyashankar committed Sep 12, 2024
1 parent da8046d commit 1583f8a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions docetl/operations/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
load_dotenv()
# litellm.set_verbose = True
DOCETL_HOME_DIR = os.path.expanduser("~/.docetl")

CACHE_DIR = os.path.join(DOCETL_HOME_DIR, "cache")
LLM_CACHE_DIR = os.path.join(DOCETL_HOME_DIR, "llm_cache")
cache = Cache(LLM_CACHE_DIR)
Expand Down Expand Up @@ -131,6 +132,8 @@ def clear_cache(console: Console = Console()):
cache.close()
# Remove all files in the cache directory
cache_dir = CACHE_DIR
if not os.path.exists(cache_dir):
os.makedirs(cache_dir)
for filename in os.listdir(cache_dir):
file_path = os.path.join(cache_dir, filename)
try:
Expand Down

0 comments on commit 1583f8a

Please sign in to comment.