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
7d8f5469
Commit
7d8f5469
authored
Jul 27, 2023
by
lintangsutawika
Browse files
fix on output_path_file
parent
b7cd829b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
main.py
main.py
+3
-2
No files found.
main.py
View file @
7d8f5469
...
@@ -24,7 +24,7 @@ def parse_args():
...
@@ -24,7 +24,7 @@ def parse_args():
help
=
"String arguments for model, e.g. `pretrained=EleutherAI/pythia-160m,dtype=float32`"
,
help
=
"String arguments for model, e.g. `pretrained=EleutherAI/pythia-160m,dtype=float32`"
,
)
)
parser
.
add_argument
(
parser
.
add_argument
(
"--tasks"
,
default
=
None
,
choices
=
utils
.
MultiChoice
(
sorted
(
ALL_TASKS
))
"--tasks"
,
default
=
None
#
, choices=utils.MultiChoice(sorted(ALL_TASKS))
)
)
parser
.
add_argument
(
parser
.
add_argument
(
"--num_fewshot"
,
"--num_fewshot"
,
...
@@ -137,6 +137,7 @@ def main():
...
@@ -137,6 +137,7 @@ def main():
eval_logger
.
warning
(
eval_logger
.
warning
(
f
"File already exists at
{
path
}
. Results will be overwritten."
f
"File already exists at
{
path
}
. Results will be overwritten."
)
)
output_path_file
=
path
.
joinpath
(
"results.json"
)
assert
not
path
.
is_file
(),
"File already exists"
assert
not
path
.
is_file
(),
"File already exists"
# if path json then get parent dir
# if path json then get parent dir
elif
path
.
suffix
in
(
".json"
,
".jsonl"
):
elif
path
.
suffix
in
(
".json"
,
".jsonl"
):
...
@@ -182,7 +183,7 @@ def main():
...
@@ -182,7 +183,7 @@ def main():
if
args
.
log_samples
:
if
args
.
log_samples
:
for
task_name
,
config
in
results
[
"configs"
].
items
():
for
task_name
,
config
in
results
[
"configs"
].
items
():
output_name
=
"{}_{}"
.
format
(
output_name
=
"{}_{}"
.
format
(
re
.
sub
(
"/"
,
"__"
,
args
.
model_args
),
task_name
re
.
sub
(
"/
|=
"
,
"__"
,
args
.
model_args
),
task_name
)
)
filename
=
path
.
joinpath
(
f
"
{
output_name
}
.jsonl"
)
filename
=
path
.
joinpath
(
f
"
{
output_name
}
.jsonl"
)
...
...
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