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
9987203f
"examples/community/unclip_image_interpolation.py" did not exist on "b25843e799d42246d7a60808259dc5c28163446f"
Commit
9987203f
authored
Sep 07, 2020
by
Jason Phang
Browse files
seed
parent
32624a1d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
1 deletion
+8
-1
lm_eval/base.py
lm_eval/base.py
+0
-1
lm_eval/tasks/glue.py
lm_eval/tasks/glue.py
+2
-0
main.py
main.py
+6
-0
No files found.
lm_eval/base.py
View file @
9987203f
...
...
@@ -78,7 +78,6 @@ class Dataset(abc.ABC):
def
fewshot_examples
(
self
,
k
):
traindocs
=
list
(
self
.
training_docs
())
random
.
seed
(
123
)
random
.
shuffle
(
traindocs
)
return
traindocs
[:
k
]
...
...
lm_eval/tasks/glue.py
View file @
9987203f
...
...
@@ -177,6 +177,8 @@ class RTE(NLP_TASK):
doc
[
"sentence2"
],
)
if
include_target
:
# 0 = entailment
# 1 = not_entailment
text
+=
" {}"
.
format
({
0
:
"True"
,
1
:
"False"
}[
doc
[
"label"
]])
return
text
...
...
main.py
View file @
9987203f
import
argparse
import
json
import
numpy
as
np
import
random
from
lm_eval
import
models
,
tasks
...
...
@@ -11,11 +13,15 @@ def parse_args():
parser
.
add_argument
(
'--tasks'
,
default
=
"all_tasks"
)
parser
.
add_argument
(
'--provide_description'
,
action
=
"store_true"
)
parser
.
add_argument
(
'--num_fewshot'
,
type
=
int
,
default
=
1
)
parser
.
add_argument
(
'--seed'
,
type
=
int
,
default
=
1234
)
return
parser
.
parse_args
()
def
main
():
args
=
parse_args
()
random
.
seed
(
args
.
seed
)
np
.
random
.
seed
(
args
.
seed
)
lm
=
models
.
get_model
(
args
.
model
).
create_from_arg_string
(
args
.
model_args
)
if
args
.
tasks
==
"all_tasks"
:
task_names
=
tasks
.
ALL_TASKS
...
...
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