Commit f832c776 authored by haileyschoelkopf's avatar haileyschoelkopf
Browse files

add additional err handling for get_git_commit_hash

parent 8d14b376
......@@ -328,9 +328,10 @@ def get_git_commit_hash():
Source: https://github.com/EleutherAI/gpt-neox/blob/b608043be541602170bfcfb8ec9bf85e8a0799e0/megatron/neox_arguments/neox_args.py#L42
"""
try:
git_hash = subprocess.check_output(["git", "describe", "--always"]).strip()
git_hash = subprocess.check_output(["gt", "describe", "--always"]).strip()
git_hash = git_hash.decode()
except subprocess.CalledProcessError:
except subprocess.CalledProcessError or FileNotFoundError:
# FileNotFoundError occurs when git not installed on system
git_hash = None
return git_hash
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment