Skip to content

Commit 526ddb8

Browse files
authored
guard on deleting secrets from env (axolotl-ai-cloud#2653) [skip ci]
1 parent f34eef5 commit 526ddb8

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

.runpod/src/handler.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,10 @@ async def handler(job):
5757
logger.info("Training Complete.")
5858

5959
# Cleanup
60-
del os.environ["WANDB_API_KEY"]
61-
del os.environ["HF_TOKEN"]
60+
if "WANDB_API_KEY" in os.environ:
61+
del os.environ["WANDB_API_KEY"]
62+
if "HF_TOKEN" in os.environ:
63+
del os.environ["HF_TOKEN"]
6264

6365

6466
runpod.serverless.start({"handler": handler, "return_aggregate_stream": True})

0 commit comments

Comments
 (0)