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
be5472a9
Commit
be5472a9
authored
Jan 25, 2024
by
lintangsutawika
Browse files
reformat
parent
7fe0ced5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
5 deletions
+4
-5
lm_eval/api/task.py
lm_eval/api/task.py
+1
-0
lm_eval/tasks/squadv2/squadv2.yaml
lm_eval/tasks/squadv2/squadv2.yaml
+1
-1
lm_eval/utils.py
lm_eval/utils.py
+2
-4
No files found.
lm_eval/api/task.py
View file @
be5472a9
...
...
@@ -40,6 +40,7 @@ ALL_OUTPUT_TYPES = [
eval_logger
=
logging
.
getLogger
(
"lm-eval"
)
@
dataclass
class
GroupConfig
(
dict
):
group
:
str
=
None
...
...
lm_eval/tasks/squadv2/squadv2.yaml
View file @
be5472a9
task
:
squadv2
class
:
!function
task.SQuAD2
\ No newline at end of file
class
:
!function
task.SQuAD2
lm_eval/utils.py
View file @
be5472a9
...
...
@@ -475,6 +475,7 @@ def get_git_commit_hash():
def
ignore_constructor
(
loader
,
node
):
return
node
def
import_function
(
loader
,
node
):
function_name
=
loader
.
construct_scalar
(
node
)
yaml_path
=
os
.
path
.
dirname
(
loader
.
name
)
...
...
@@ -482,9 +483,7 @@ def import_function(loader, node):
*
module_name
,
function_name
=
function_name
.
split
(
"."
)
if
isinstance
(
module_name
,
list
):
module_name
=
"."
.
join
(
module_name
)
module_path
=
os
.
path
.
normpath
(
os
.
path
.
join
(
yaml_path
,
"{}.py"
.
format
(
module_name
))
)
module_path
=
os
.
path
.
normpath
(
os
.
path
.
join
(
yaml_path
,
"{}.py"
.
format
(
module_name
)))
spec
=
importlib
.
util
.
spec_from_file_location
(
module_name
,
module_path
)
module
=
importlib
.
util
.
module_from_spec
(
spec
)
...
...
@@ -495,7 +494,6 @@ def import_function(loader, node):
def
load_yaml_config
(
mode
=
"simple"
,
yaml_path
=
None
,
yaml_config
=
None
,
yaml_dir
=
None
):
if
mode
==
"simple"
:
constuctor_fn
=
ignore_constructor
elif
mode
==
"full"
:
...
...
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