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