Skip to content

Commit 7abe9b5

Browse files
authored
Merge pull request #1372 from clayne/1743815607-wandb-api-key-vs-token
Use correct HF token and WanDB api-key env-vars
2 parents 351413a + bc8ce11 commit 7abe9b5

File tree

2 files changed

+18
-8
lines changed

2 files changed

+18
-8
lines changed

docker-start.sh

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# This file can then later be sourced in a login shell
55
echo "Exporting environment variables..."
66
printenv |
7-
grep -E '^RUNPOD_|^PATH=|^HF_HOME=|^HUGGING_FACE_HUB_TOKEN=|^_=' |
7+
grep -E '^RUNPOD_|^PATH=|^HF_HOME=|^HF_TOKEN=|^HUGGING_FACE_HUB_TOKEN=|^WANDB_API_KEY=|^WANDB_TOKEN=|^_=' |
88
sed 's/^\(.*\)=\(.*\)$/export \1="\2"/' >>/etc/rp_environment
99

1010
# Add it to Bash login script
@@ -26,9 +26,19 @@ fi
2626
# Start SSH server
2727
service ssh start
2828

29-
# Load HF, WanDB tokens
30-
if [ -n "$HUGGING_FACE_HUB_TOKEN" ]; then huggingface-cli login --token "$HUGGING_FACE_HUB_TOKEN" --add-to-git-credential; else echo "HUGGING_FACE_HUB_TOKEN not set; skipping login"; fi
31-
if [ -n "$WANDB_TOKEN" ]; then wandb login "$WANDB_TOKEN"; else echo "WANDB_TOKEN not set; skipping login"; fi
29+
# Login to HF
30+
if [[ -n "${HF_TOKEN:-$HUGGING_FACE_HUB_TOKEN}" ]]; then
31+
huggingface-cli login --token "${HF_TOKEN:-$HUGGING_FACE_HUB_TOKEN}" --add-to-git-credential
32+
else
33+
echo "HF_TOKEN or HUGGING_FACE_HUB_TOKEN not set; skipping login"
34+
fi
35+
36+
# Login to WanDB
37+
if [[ -n "${WANDB_API_KEY:-$WANDB_TOKEN}" ]]; then
38+
wandb login "${WANDB_API_KEY:-$WANDB_TOKEN}"
39+
else
40+
echo "WANDB_API_KEY or WANDB_TOKEN not set; skipping login"
41+
fi
3242

3343
# 🫡
3444
sleep infinity

documentation/DOCKER.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ This command sets up the container with GPU access and maps the SSH port for ext
3939
To facilitate integration with external tools, the container supports environment variables for Huggingface and WandB tokens. Pass these at runtime as follows:
4040

4141
```bash
42-
docker run --gpus all -e HUGGING_FACE_HUB_TOKEN='your_token' -e WANDB_TOKEN='your_token' -it -p 22:22 simpletuner
42+
docker run --gpus all -e HF_TOKEN='your_token' -e WANDB_API_KEY='your_token' -it -p 22:22 simpletuner
4343
```
4444

4545
### 4. Data Volumes
@@ -98,8 +98,8 @@ services:
9898
- "[path to your datasets]:/datasets"
9999
- "[path to your configs]:/workspace/SimpleTuner/config"
100100
environment:
101-
HUGGING_FACE_HUB_TOKEN: [your hugging face token]
102-
WANDB_TOKEN: [your wanddb token]
101+
HF_TOKEN: [your hugging face token]
102+
WANDB_API_KEY: [your wanddb token]
103103
command: ["tail", "-f", "/dev/null"]
104104
deploy:
105105
resources:
@@ -155,4 +155,4 @@ services:
155155
### General Advice
156156

157157
- **Logs and Output**: Review the container logs and output for any error messages or warnings that can provide more context on the issue.
158-
- **Documentation and Forums**: Consult the Docker and NVIDIA CUDA documentation for more detailed troubleshooting advice. Community forums and issue trackers related to the specific software or dependencies you are using can also be valuable resources.
158+
- **Documentation and Forums**: Consult the Docker and NVIDIA CUDA documentation for more detailed troubleshooting advice. Community forums and issue trackers related to the specific software or dependencies you are using can also be valuable resources.

0 commit comments

Comments
 (0)