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
c0c7a72f
Commit
c0c7a72f
authored
Dec 02, 2024
by
Baber
Browse files
nit
parent
5ed56f7c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
5 deletions
+1
-5
lm_eval/api/instance.py
lm_eval/api/instance.py
+1
-5
No files found.
lm_eval/api/instance.py
View file @
c0c7a72f
from
dataclasses
import
dataclass
,
field
from
typing
import
Literal
,
Optional
,
Tuple
from
lm_eval.api.types
import
GenerateUntilRequest
,
LogLiklehoodRequest
OutputType
=
Literal
[
"loglikelihood"
,
"loglikelihood_rolling"
,
"generate_until"
,
"multiple_choice"
...
...
@@ -36,7 +34,5 @@ class Instance:
Returns (string,) where `string` is the string to calculate loglikelihood over
"""
return
(
GenerateUntilRequest
(
*
self
.
arguments
)
if
self
.
request_type
!=
"generate_until"
else
LogLiklehoodRequest
(
*
self
.
arguments
)
self
.
arguments
if
isinstance
(
self
.
arguments
,
tuple
)
else
(
self
.
arguments
,)
)
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