thomas-schweich commited on
Commit
d6d0f4e
·
1 Parent(s): 190085d

Persist HF_TOKEN to cache file in entrypoint (survives /start.sh env changes)

Browse files
Files changed (1) hide show
  1. deploy/entrypoint-run.sh +6 -0
deploy/entrypoint-run.sh CHANGED
@@ -6,6 +6,12 @@ set -e
6
  cd /opt/pawn
7
  export PYTHONPATH=/opt/pawn
8
 
 
 
 
 
 
 
9
  # Let Runpod's own start script handle SSH, Jupyter, key injection, etc.
10
  if [ -f /start.sh ]; then
11
  /start.sh &
 
6
  cd /opt/pawn
7
  export PYTHONPATH=/opt/pawn
8
 
9
+ # Persist HF_TOKEN to huggingface-hub's token cache so it survives env changes
10
+ if [ -n "$HF_TOKEN" ]; then
11
+ mkdir -p /root/.cache/huggingface
12
+ echo -n "$HF_TOKEN" > /root/.cache/huggingface/token
13
+ fi
14
+
15
  # Let Runpod's own start script handle SSH, Jupyter, key injection, etc.
16
  if [ -f /start.sh ]; then
17
  /start.sh &