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
9c3ba7d4
Commit
9c3ba7d4
authored
Nov 21, 2023
by
lintangsutawika
Browse files
renamed greedy_until to generate_until
parent
0e1538e9
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
lm_eval/models/openai_completions.py
lm_eval/models/openai_completions.py
+5
-5
No files found.
lm_eval/models/openai_completions.py
View file @
9c3ba7d4
...
...
@@ -228,7 +228,7 @@ class OpenaiCompletionsLM(LM):
self
.
cache_hook
.
add_partial
(
"loglikelihood"
,
cache_key
,
answer
)
return
re_ord
.
get_original
(
res
)
def
g
reedy
_until
(
self
,
requests
)
->
List
[
str
]:
def
g
enerate
_until
(
self
,
requests
)
->
List
[
str
]:
if
not
requests
:
return
[]
res
=
[]
...
...
@@ -285,7 +285,7 @@ class OpenaiCompletionsLM(LM):
# partial caching
self
.
cache_hook
.
add_partial
(
"g
reedy
_until"
,
(
context
,
{
"until"
:
until_
}),
s
"g
enerate
_until"
,
(
context
,
{
"until"
:
until_
}),
s
)
res
.
append
(
s
)
...
...
@@ -296,7 +296,7 @@ class OpenaiCompletionsLM(LM):
raise
NotImplementedError
()
def
_model_generate
(
self
,
context
,
max_length
,
eos_token_id
):
# Isn't used because we override g
reedy
_until
# Isn't used because we override g
enerate
_until
raise
NotImplementedError
()
def
loglikelihood_rolling
(
self
,
requests
)
->
List
[
float
]:
...
...
@@ -404,7 +404,7 @@ class OpenaiChatCompletionsLM(LM):
continuation_enc
=
whole_enc
[
context_enc_len
:]
return
context_enc
,
continuation_enc
def
g
reedy
_until
(
self
,
requests
)
->
List
[
str
]:
def
g
enerate
_until
(
self
,
requests
)
->
List
[
str
]:
if
not
requests
:
return
[]
res
=
[]
...
...
@@ -461,7 +461,7 @@ class OpenaiChatCompletionsLM(LM):
# partial caching
self
.
cache_hook
.
add_partial
(
"g
reedy
_until"
,
(
context
,
{
"until"
:
until_
}),
s
"g
enerate
_until"
,
(
context
,
{
"until"
:
until_
}),
s
)
res
.
append
(
s
)
...
...
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