Ouiam123 commited on
Commit
a8045ce
·
verified ·
1 Parent(s): c5c17d1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
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 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")
 
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")