Skip to content

Commit fe6907a

Browse files
danl-aisiclaude
andcommitted
Revert "Generalise demo HF cache; drop $PROJECTDIR assumption"
This reverts commit 2842c3b — restore demo_slurm's original $PROJECTDIR/huggingface-cache convention. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 5b6a72d commit fe6907a

1 file changed

Lines changed: 3 additions & 13 deletions

File tree

examples/slurm_inspect/demo_slurm.py

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -216,18 +216,6 @@ def demo_slurm(
216216
if vanilla and container is None:
217217
container = find_latest_container()
218218

219-
# Resolve a persistent HF cache shared between this login-node pre-download and
220-
# the offline compute job. Honour the user's HF_* env (on Isambard the site
221-
# profile already points these at writable per-user scratch); otherwise fall back
222-
# to HF's default cache. Avoids assuming a site-specific shared dir such as
223-
# $PROJECTDIR/huggingface-cache, which need not exist, be writable, or be yours.
224-
hf_home = os.environ.get("HF_HOME") or str(Path.home() / ".cache" / "huggingface")
225-
hf_cache_env = {
226-
"HF_HUB_CACHE": os.environ.get("HF_HUB_CACHE", f"{hf_home}/hub"),
227-
"HF_ASSETS_CACHE": os.environ.get("HF_ASSETS_CACHE", f"{hf_home}/assets"),
228-
"HF_XET_CACHE": os.environ.get("HF_XET_CACHE", f"{hf_home}/xet"),
229-
}
230-
231219
# Compute serving config and submit jobs
232220
jobs: list[JobInfo] = []
233221

@@ -254,7 +242,9 @@ def demo_slurm(
254242
switches=switches,
255243
env={
256244
"HF_HUB_OFFLINE": "1",
257-
**hf_cache_env,
245+
"HF_ASSETS_CACHE": f"{os.environ['PROJECTDIR']}/huggingface-cache/assets",
246+
"HF_HUB_CACHE": f"{os.environ['PROJECTDIR']}/huggingface-cache/hub",
247+
"HF_XET_CACHE": f"{os.environ['PROJECTDIR']}/huggingface-cache/xet",
258248
"AISITOOLS_DISABLE_HOOKS": "1",
259249
},
260250
debug=debug,

0 commit comments

Comments
 (0)