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
3f0afe02
Commit
3f0afe02
authored
Jun 19, 2023
by
haileyschoelkopf
Browse files
misc fixes
parent
de21abbd
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
21 additions
and
5 deletions
+21
-5
lm_eval/api/model.py
lm_eval/api/model.py
+14
-0
lm_eval/models/anthropic_llms.py
lm_eval/models/anthropic_llms.py
+3
-1
lm_eval/models/openai_completions.py
lm_eval/models/openai_completions.py
+1
-1
lm_eval/tasks/lambada/lambada_openai.yaml
lm_eval/tasks/lambada/lambada_openai.yaml
+1
-1
lm_eval/tasks/lambada/lambada_standard.yaml
lm_eval/tasks/lambada/lambada_standard.yaml
+1
-1
lm_eval/tasks/lambada_cloze/lambada_openai_cloze.yaml
lm_eval/tasks/lambada_cloze/lambada_openai_cloze.yaml
+1
-1
No files found.
lm_eval/api/model.py
View file @
3f0afe02
...
...
@@ -104,3 +104,17 @@ class LM(abc.ABC):
args
=
utils
.
simple_parse_args_string
(
arg_string
)
args2
=
{
k
:
v
for
k
,
v
in
additional_config
.
items
()
if
v
is
not
None
}
return
cls
(
**
args
,
**
args2
)
@
property
def
rank
(
self
):
# used in the case of parallelism. Hardcoded to
# ensure no errors arise using API models which do
# not support multi-device parallelism nor expect it.
return
0
@
property
def
world_size
(
self
):
# used in the case of parallelism. Hardcoded to
# ensure no errors arise using API models which do
# not support multi-device parallelism nor expect it.
return
1
lm_eval/models/anthropic_llms.py
View file @
3f0afe02
import
os
from
lm_eval.base
import
BaseLM
from
lm_eval.api.model
import
LM
from
lm_eval.api.registry
import
register_model
from
tqdm
import
tqdm
import
time
...
...
@@ -37,6 +38,7 @@ def anthropic_completion(
backoff_time
*=
1.5
@
register_model
(
"anthropic"
)
class
AnthropicLM
(
BaseLM
):
REQ_CHUNK_SIZE
=
20
...
...
lm_eval/models/openai_completions.py
View file @
3f0afe02
...
...
@@ -58,7 +58,7 @@ def oa_completion(**kwargs):
@
register_model
(
"openai"
,
"openai-completions"
,
"gooseai"
)
class
GPT3
LM
(
LM
):
class
OpenaiCompletions
LM
(
LM
):
REQ_CHUNK_SIZE
=
20
def
__init__
(
self
,
engine
,
truncate
=
False
):
...
...
lm_eval/tasks/lambada/lambada_openai.yaml
View file @
3f0afe02
...
...
@@ -16,6 +16,6 @@ metric_list:
-
metric
:
perplexity
aggregation
:
perplexity
higher_is_better
:
false
-
metric
:
acc
uracy
-
metric
:
acc
aggregation
:
mean
higher_is_better
:
true
lm_eval/tasks/lambada/lambada_standard.yaml
View file @
3f0afe02
...
...
@@ -17,6 +17,6 @@ metric_list:
-
metric
:
perplexity
aggregation
:
perplexity
higher_is_better
:
false
-
metric
:
acc
uracy
-
metric
:
acc
aggregation
:
mean
higher_is_better
:
true
lm_eval/tasks/lambada_cloze/lambada_openai_cloze.yaml
View file @
3f0afe02
...
...
@@ -15,6 +15,6 @@ metric_list:
-
metric
:
perplexity
aggregation
:
perplexity
higher_is_better
:
false
-
metric
:
acc
uracy
-
metric
:
acc
aggregation
:
mean
higher_is_better
:
true
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