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
chenpangpang
transformers
Commits
e30ceae0
"docs/source/vscode:/vscode.git/clone" did not exist on "e2dc558e9c8eae3409481ca74efc15e07f8e90c8"
Unverified
Commit
e30ceae0
authored
May 23, 2023
by
Nicolas Patry
Committed by
GitHub
May 23, 2023
Browse files
small fix to remove unused eos in processor when it's not used. (#23408)
parent
2f424d79
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
src/transformers/convert_slow_tokenizer.py
src/transformers/convert_slow_tokenizer.py
+5
-1
No files found.
src/transformers/convert_slow_tokenizer.py
View file @
e30ceae0
...
@@ -1175,7 +1175,11 @@ class LlamaConverter(SpmConverter):
...
@@ -1175,7 +1175,11 @@ class LlamaConverter(SpmConverter):
single
=
f
"
{
(
bos
+
':0 '
)
*
add_bos
}
$A:0
{
(
' '
+
eos
+
':0'
)
*
add_eos
}
"
single
=
f
"
{
(
bos
+
':0 '
)
*
add_bos
}
$A:0
{
(
' '
+
eos
+
':0'
)
*
add_eos
}
"
pair
=
f
"
{
single
}{
(
' '
+
bos
+
':1'
)
*
add_bos
}
$B:1
{
(
' '
+
eos
+
':1'
)
*
add_eos
}
"
pair
=
f
"
{
single
}{
(
' '
+
bos
+
':1'
)
*
add_bos
}
$B:1
{
(
' '
+
eos
+
':1'
)
*
add_eos
}
"
special_tokens
=
[(
bos
,
bos_token_id
),
(
eos
,
eos_token_id
)]
special_tokens
=
[]
if
add_bos
:
special_tokens
.
append
((
bos
,
bos_token_id
))
if
add_eos
:
special_tokens
.
append
((
eos
,
eos_token_id
))
return
processors
.
TemplateProcessing
(
single
=
single
,
pair
=
pair
,
special_tokens
=
special_tokens
)
return
processors
.
TemplateProcessing
(
single
=
single
,
pair
=
pair
,
special_tokens
=
special_tokens
)
else
:
else
:
...
...
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