pittman commited on
Commit
60506df
·
verified ·
1 Parent(s): 9cab2c4

Update src/streamlit_app.py

Browse files
Files changed (1) hide show
  1. src/streamlit_app.py +3 -3
src/streamlit_app.py CHANGED
@@ -3,11 +3,11 @@ import os
3
  import shutil # Built-in, no need for pip
4
  from transformers import pipeline
5
 
6
- # Set custom writable cache directory to avoid permission issues
7
- os.environ['HF_HOME'] = '/home/user/.cache/huggingface'
8
  cache_dir = os.environ['HF_HOME']
9
 
10
- # Create cache dir if not exists
11
  os.makedirs(cache_dir, exist_ok=True)
12
 
13
  # Clear any lock files in cache to fix interrupted downloads
 
3
  import shutil # Built-in, no need for pip
4
  from transformers import pipeline
5
 
6
+ # Set custom writable cache directory in /tmp to avoid permission issues
7
+ os.environ['HF_HOME'] = '/tmp/huggingface_cache'
8
  cache_dir = os.environ['HF_HOME']
9
 
10
+ # Create cache dir if not exists ( /tmp is always writable in containers)
11
  os.makedirs(cache_dir, exist_ok=True)
12
 
13
  # Clear any lock files in cache to fix interrupted downloads