From 8f42012a9ee2e2684f2615afb3b7e3c17e6b6a9d Mon Sep 17 00:00:00 2001 From: Tom Noonan II Date: Thu, 26 Jun 2025 14:31:59 -0400 Subject: [PATCH] Do not override TIKTOKEN_CACHE_DIR if the user has set it --- private_gpt/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/private_gpt/__init__.py b/private_gpt/__init__.py index 360b53a4..e41700c5 100644 --- a/private_gpt/__init__.py +++ b/private_gpt/__init__.py @@ -24,4 +24,5 @@ os.environ["GRADIO_ANALYTICS_ENABLED"] = "False" # os.environ["ANONYMIZED_TELEMETRY"] = "False" # adding tiktoken cache path within repo to be able to run in offline environment. -os.environ["TIKTOKEN_CACHE_DIR"] = "tiktoken_cache" +# Only set to cache within the repo if the user has not declared a cache path +os.environ.setdefault("TIKTOKEN_CACHE_DIR", "tiktoken_cache")