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
2091a0f1
Commit
2091a0f1
authored
May 15, 2023
by
lintangsutawika
Browse files
no need for yaml loader function
parent
a179c472
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
22 deletions
+1
-22
lm_eval/utils.py
lm_eval/utils.py
+1
-22
No files found.
lm_eval/utils.py
View file @
2091a0f1
...
...
@@ -256,30 +256,9 @@ def get_git_commit_hash():
return
git_hash
def
get_yaml_config
(
yaml_path
):
with
open
(
yaml_path
,
"r"
)
as
f
:
return
yaml
.
load
(
f
,
yaml
.
Loader
)
def
RegistryDecorator
():
registry
=
{}
def
registrar
(
func
):
if
func
.
TASK_NAME
is
None
:
name
=
func
.
__name__
else
:
name
=
func
.
TASK_NAME
registry
[
name
]
=
func
return
func
registrar
.
all
=
registry
return
registrar
register_task
=
RegistryDecorator
()
env
=
Environment
(
loader
=
BaseLoader
,
undefined
=
StrictUndefined
)
def
apply_template
(
template
,
doc
):
rtemplate
=
env
.
from_string
(
template
)
return
rtemplate
.
render
(
**
doc
)
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