MCPcopy Create free account
hub / github.com/OpenSparseLLMs/MoM / get_git_commit_hash

Function get_git_commit_hash

lm-eval-harness/lm_eval/utils.py:334–345  ·  view source on GitHub ↗

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

()

Source from the content-addressed store, hash-verified

332
333
334def 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
348def ignore_constructor(loader, node):

Callers 1

simple_evaluateFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected