Kipok / NeMo-Skills

A pipeline to improve skills of large language models
https://kipok.github.io/NeMo-Skills/
Apache License 2.0
185 stars 41 forks source link

Add support for env variable passthrough and env variable mounting #129

Closed titu1994 closed 1 month ago

titu1994 commented 1 month ago

This pr adds a few flags for processing by the server creation engine before it executes

The server config can have the following additional args

This enables for dynamic mounting by the user without the hardcoding of local and slurm mount paths - all users can share the same config file, and simply populate the mount paths via personal environment variables provided in their private .bashrc or .profile (or even explicit export).

This will reduce the number of copy pasted user-defined versions of the example server configs and prevent users from having to manually maintain and update their configs as and when the core repo updates with newer containers.

Example

# cluster_configs/local.yaml
...

# optional env variables
env_vars: ['NEMO_SKILLS_CONFIG']
# required env variables
required_env_vars: ['HF_HOME', 'HF_TOKEN']

# mounting determined by environment variables
env_mounts:
  - "{HF_HOME}:/cache/huggingface"