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
3369f887
Commit
3369f887
authored
May 14, 2024
by
Konrad
Browse files
system inst default update
parent
9dfb58a3
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
lm_eval/api/task.py
lm_eval/api/task.py
+3
-3
lm_eval/evaluator.py
lm_eval/evaluator.py
+2
-2
No files found.
lm_eval/api/task.py
View file @
3369f887
...
@@ -986,7 +986,7 @@ class ConfigurableTask(Task):
...
@@ -986,7 +986,7 @@ class ConfigurableTask(Task):
self
,
self
,
doc
:
str
,
doc
:
str
,
num_fewshot
:
int
,
num_fewshot
:
int
,
system_instruction
:
str
=
""
,
system_instruction
:
str
=
None
,
apply_chat_template
:
bool
=
False
,
apply_chat_template
:
bool
=
False
,
tokenizer
=
None
,
tokenizer
=
None
,
)
->
str
:
)
->
str
:
...
@@ -1017,11 +1017,11 @@ class ConfigurableTask(Task):
...
@@ -1017,11 +1017,11 @@ class ConfigurableTask(Task):
description
=
utils
.
apply_template
(
self
.
config
.
description
,
doc
)
description
=
utils
.
apply_template
(
self
.
config
.
description
,
doc
)
# create system prompt based on the provided system instruction and description
# create system prompt based on the provided system instruction and description
if
system_instruction
and
description
:
if
system_instruction
is
not
None
and
description
:
system_prompt
=
(
system_prompt
=
(
f
"
{
system_instruction
}{
self
.
sampler
.
fewshot_delimiter
}{
description
}
"
f
"
{
system_instruction
}{
self
.
sampler
.
fewshot_delimiter
}{
description
}
"
)
)
elif
system_instruction
:
elif
system_instruction
is
not
None
:
system_prompt
=
system_instruction
system_prompt
=
system_instruction
elif
description
:
elif
description
:
system_prompt
=
description
system_prompt
=
description
...
...
lm_eval/evaluator.py
View file @
3369f887
...
@@ -55,7 +55,7 @@ def simple_evaluate(
...
@@ -55,7 +55,7 @@ def simple_evaluate(
check_integrity
:
bool
=
False
,
check_integrity
:
bool
=
False
,
write_out
:
bool
=
False
,
write_out
:
bool
=
False
,
log_samples
:
bool
=
True
,
log_samples
:
bool
=
True
,
system_instruction
:
str
=
""
,
system_instruction
:
str
=
None
,
apply_chat_template
:
bool
=
False
,
apply_chat_template
:
bool
=
False
,
gen_kwargs
:
Optional
[
str
]
=
None
,
gen_kwargs
:
Optional
[
str
]
=
None
,
task_manager
:
Optional
[
TaskManager
]
=
None
,
task_manager
:
Optional
[
TaskManager
]
=
None
,
...
@@ -325,7 +325,7 @@ def evaluate(
...
@@ -325,7 +325,7 @@ def evaluate(
bootstrap_iters
:
Optional
[
int
]
=
100000
,
bootstrap_iters
:
Optional
[
int
]
=
100000
,
write_out
:
bool
=
False
,
write_out
:
bool
=
False
,
log_samples
:
bool
=
True
,
log_samples
:
bool
=
True
,
system_instruction
:
str
=
""
,
system_instruction
:
str
=
None
,
apply_chat_template
:
bool
=
False
,
apply_chat_template
:
bool
=
False
,
verbosity
:
str
=
"INFO"
,
verbosity
:
str
=
"INFO"
,
):
):
...
...
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