Skip to content

fix: HF env variables not being set when offline mode is False#43

Merged
Neonkraft merged 2 commits into
mainfrom
fix/hf-env-vars
Jul 3, 2026
Merged

fix: HF env variables not being set when offline mode is False#43
Neonkraft merged 2 commits into
mainfrom
fix/hf-env-vars

Conversation

@Neonkraft

Copy link
Copy Markdown
Collaborator

Summary

_apply_hf_env_from_file was only called inside the if config.offline: block in scripts/submit.py, so HF cache env vars (HF_HOME, HF_HUB_CACHE, etc.) from container.env_file were never applied on the login node when offline=False. This moves the call above the offline check so the env vars are always applied whenever a container env_file is configured, regardless of offline mode.

Type of change

  • Bug fix
  • New feature
  • Refactor
  • Performance
  • Documentation
  • Maintenance

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes Hugging Face cache environment variables not being applied on the login node when offline=False, by ensuring the container env_file is parsed and HF cache vars are exported into the submit process environment regardless of offline mode.

Changes:

  • Move _apply_hf_env_from_file(config.container.env_file) to run before the config.offline check.
  • Ensure HF cache env vars (e.g., HF_HOME, HF_HUB_CACHE) are consistently applied whenever container.env_file is configured.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Neonkraft Neonkraft merged commit 2b75949 into main Jul 3, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants