Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gaoqiong
lm-evaluation-harness
Commits
f1beac00
"driver/src/driver.cpp" did not exist on "6d066ede00be22d5c4f23c812c48b60b0525b4f1"
Commit
f1beac00
authored
May 08, 2023
by
haileyschoelkopf
Browse files
save git hash to results dump
parent
38244e15
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
1 deletion
+15
-1
lm_eval/evaluator.py
lm_eval/evaluator.py
+2
-1
lm_eval/utils.py
lm_eval/utils.py
+13
-0
No files found.
lm_eval/evaluator.py
View file @
f1beac00
...
@@ -6,7 +6,7 @@ import lm_eval.api.metrics
...
@@ -6,7 +6,7 @@ import lm_eval.api.metrics
import
lm_eval.models
import
lm_eval.models
import
lm_eval.tasks
import
lm_eval.tasks
import
lm_eval.api
import
lm_eval.api
from
lm_eval.utils
import
positional_deprecated
,
run_task_tests
,
make_table
from
lm_eval.utils
import
positional_deprecated
,
run_task_tests
,
make_table
,
get_git_commit_hash
@
positional_deprecated
@
positional_deprecated
...
@@ -90,6 +90,7 @@ def simple_evaluate(
...
@@ -90,6 +90,7 @@ def simple_evaluate(
"limit"
:
limit
,
"limit"
:
limit
,
"bootstrap_iters"
:
bootstrap_iters
,
"bootstrap_iters"
:
bootstrap_iters
,
}
}
results
[
"git_hash"
]
=
get_git_commit_hash
()
return
results
return
results
...
...
lm_eval/utils.py
View file @
f1beac00
...
@@ -240,6 +240,19 @@ def run_task_tests(task_list: List[str]):
...
@@ -240,6 +240,19 @@ def run_task_tests(task_list: List[str]):
)
)
def
get_git_commit_hash
():
"""
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
"""
try
:
git_hash
=
subprocess
.
check_output
([
"git"
,
"describe"
,
"--always"
]).
strip
()
git_hash
=
git_hash
.
decode
()
except
subprocess
.
CalledProcessError
:
git_hash
=
None
return
git_hash
env
=
Environment
(
loader
=
BaseLoader
,
undefined
=
StrictUndefined
)
env
=
Environment
(
loader
=
BaseLoader
,
undefined
=
StrictUndefined
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment