Gets the git commit hash of your current repo (if it exists). Source: https://github.com/EleutherAI/gpt-neox/blob/b608043be541602170bfcfb8ec9bf85e8a0799e0/megatron/neox_arguments/neox_args.py#L42
()
| 332 | |
| 333 | |
| 334 | def get_git_commit_hash(): |
| 335 | """ |
| 336 | Gets the git commit hash of your current repo (if it exists). |
| 337 | Source: https://github.com/EleutherAI/gpt-neox/blob/b608043be541602170bfcfb8ec9bf85e8a0799e0/megatron/neox_arguments/neox_args.py#L42 |
| 338 | """ |
| 339 | try: |
| 340 | git_hash = subprocess.check_output(["git", "describe", "--always"]).strip() |
| 341 | git_hash = git_hash.decode() |
| 342 | except subprocess.CalledProcessError or FileNotFoundError: |
| 343 | # FileNotFoundError occurs when git not installed on system |
| 344 | git_hash = None |
| 345 | return git_hash |
| 346 | |
| 347 | |
| 348 | def ignore_constructor(loader, node): |