referring to this function in the code:
|
if path.startswith(mount_dest): |
Ex.
mounts:
- /lustre/path/to/models/cache/huggingface:/cache/huggingface
env_vars:
- HF_HOME=/lustre/path/to/models/cache/huggingface
>>> import yaml
>>> from nemo_skills.pipeline.utils.mounts import is_mounted_filepath
>>> from nemo_skills.pipeline.utils.cluster import get_env_variables
>>> with open('cluster.yaml', 'r') as f:
... config = yaml.safe_load(f)
...
>>> env_vars = get_env_variables(config)
>>> env_vars
{'HF_HOME': '/lustre/path/to/models/cache/huggingface', ...}
>>> is_mounted_filepath(config, env_vars['HF_HOME'])
False
Here is the code in the current function:
mounts = mounts or (get_mounts_from_config(cluster_config) + ["/nemo_run/code:/nemo_run/code"])
# Find which mount path matches the filepaths prefix
for mount in mounts:
mount_source, mount_dest = mount.split(":")
if path.startswith(mount_dest):
return True
So I have: /lustre/path/to/models/cache/huggingface:/cache/huggingface
which is split up as:
mount_source= /lustre/path/to/models/cache/huggingface
mount_dest=cache/huggingface\
then checks if HF_HOME=/lustre/path/to/models/cache/huggingface starts with mount_dest=/cache/huggingface
That’s dumb logic - it wants the mount point outside to be the same start string as inside the container.
referring to this function in the code:
Skills/nemo_skills/pipeline/utils/mounts.py
Line 43 in d77caab
Ex.
Here is the code in the current function:
So I have:
/lustre/path/to/models/cache/huggingface:/cache/huggingfacewhich is split up as:
then checks if
HF_HOME=/lustre/path/to/models/cache/huggingfacestarts withmount_dest=/cache/huggingfaceThat’s dumb logic - it wants the mount point outside to be the same start string as inside the container.