use robust envs

Former-commit-id: f3e194c3b3c40a3e6c3c5397ec0d859e6db614b5
This commit is contained in:
hiyouga
2024-05-14 21:36:42 +08:00
parent 84ff56c3a0
commit 6670b36c49
5 changed files with 6 additions and 6 deletions

View File

@@ -58,7 +58,7 @@ class AverageMeter:
def check_dependencies() -> None:
if int(os.environ.get("DISABLE_VERSION_CHECK", "0")):
if os.environ.get("DISABLE_VERSION_CHECK", "0").lower() in ["true", "1"]:
logger.warning("Version checking has been disabled, may lead to unexpected behaviors.")
else:
require_version("transformers>=4.37.2", "To fix: pip install transformers>=4.37.2")