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
c47de8be
Commit
c47de8be
authored
Jan 15, 2024
by
haileyschoelkopf
Browse files
update Instance.args setter
parent
2b40017b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
lm_eval/api/instance.py
lm_eval/api/instance.py
+5
-2
No files found.
lm_eval/api/instance.py
View file @
c47de8be
...
...
@@ -31,13 +31,16 @@ class Instance:
return
(
self
.
arguments
if
isinstance
(
self
.
arguments
,
tuple
)
else
(
self
.
arguments
,)
)
@
args
.
setter
def
args
(
self
,
new_arguments
:
tuple
)
->
None
:
"""
Update the arguments of this instance with a new one
"""
if
isinstance
(
new_arguments
,
tuple
):
assert
(
len
(
new_arguments
)
==
len
(
self
.
args
)
),
"Must set new Instance arguments to have same size + types as old arguments"
self
.
arguments
=
new_arguments
else
:
print
(
"Please enter a valid arguments
tuple"
)
raise
ValueError
(
"Must set new Instance args to a
tuple
!
"
)
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