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
31833bf8
Commit
31833bf8
authored
Nov 21, 2024
by
Baber
Browse files
remove whitespaces from anthropic stop sequences
parent
867413f8
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
0 deletions
+4
-0
lm_eval/models/anthropic_llms.py
lm_eval/models/anthropic_llms.py
+4
-0
No files found.
lm_eval/models/anthropic_llms.py
View file @
31833bf8
...
@@ -322,6 +322,10 @@ class AnthropicChat(LocalCompletionsAPI):
...
@@ -322,6 +322,10 @@ class AnthropicChat(LocalCompletionsAPI):
max_tokens
=
gen_kwargs
.
pop
(
"max_gen_toks"
,
self
.
_max_gen_toks
)
max_tokens
=
gen_kwargs
.
pop
(
"max_gen_toks"
,
self
.
_max_gen_toks
)
temperature
=
gen_kwargs
.
pop
(
"temperature"
,
0
)
temperature
=
gen_kwargs
.
pop
(
"temperature"
,
0
)
stop
=
gen_kwargs
.
pop
(
"until"
,
[
"
\n\n
Human:"
])
stop
=
gen_kwargs
.
pop
(
"until"
,
[
"
\n\n
Human:"
])
# anthropic doesn't allow whitespace stop sequences
stop
=
[
x
for
x
in
stop
if
not
x
.
isspace
()]
if
not
stop
:
stop
=
[
"
\n\n
Human:"
]
if
not
isinstance
(
stop
,
list
):
if
not
isinstance
(
stop
,
list
):
stop
=
[
stop
]
stop
=
[
stop
]
out
=
{
out
=
{
...
...
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