Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -8,9 +8,12 @@ from dotenv import load_dotenv
|
|
8 |
# Load environment variables
|
9 |
load_dotenv()
|
10 |
|
11 |
-
#
|
12 |
-
|
13 |
-
|
|
|
|
|
|
|
14 |
|
15 |
# Retrieve the Hugging Face API token from environment variables
|
16 |
api_token = os.getenv("ttt")
|
|
|
8 |
# Load environment variables
|
9 |
load_dotenv()
|
10 |
|
11 |
+
# Set the cache directory to the one specified in the environment variable
|
12 |
+
cache_dir = os.getenv("TRANSFORMERS_CACHE", "/.cache/huggingface/hub")
|
13 |
+
|
14 |
+
# Ensure the cache directory is writable
|
15 |
+
os.makedirs(cache_dir, exist_ok=True)
|
16 |
+
os.environ["TRANSFORMERS_CACHE"] = cache_dir
|
17 |
|
18 |
# Retrieve the Hugging Face API token from environment variables
|
19 |
api_token = os.getenv("ttt")
|