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
db8c7cae
Unverified
Commit
db8c7cae
authored
Aug 01, 2024
by
Viktor Scherbakov
Committed by
GitHub
Aug 01, 2024
Browse files
Empty list in defaults for LLaMA special tokens during weights conversion (#32342)
empty list in defaults
parent
2229ebe7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
src/transformers/models/llama/convert_llama_weights_to_hf.py
src/transformers/models/llama/convert_llama_weights_to_hf.py
+2
-1
No files found.
src/transformers/models/llama/convert_llama_weights_to_hf.py
View file @
db8c7cae
...
@@ -449,7 +449,8 @@ def main():
...
@@ -449,7 +449,8 @@ def main():
if
args
.
model_size
is
None
and
args
.
num_shards
is
None
:
if
args
.
model_size
is
None
and
args
.
num_shards
is
None
:
raise
ValueError
(
"You have to set at least `num_shards` if you are not giving the `model_size`"
)
raise
ValueError
(
"You have to set at least `num_shards` if you are not giving the `model_size`"
)
if
args
.
special_tokens
is
None
:
if
args
.
special_tokens
is
None
:
args
.
special_tokens
=
DEFAULT_LLAMA_SPECIAL_TOKENS
[
str
(
args
.
llama_version
)]
# no special tokens by default
args
.
special_tokens
=
DEFAULT_LLAMA_SPECIAL_TOKENS
.
get
(
str
(
args
.
llama_version
),
[])
spm_path
=
os
.
path
.
join
(
args
.
input_dir
,
"tokenizer.model"
)
spm_path
=
os
.
path
.
join
(
args
.
input_dir
,
"tokenizer.model"
)
vocab_size
=
len
(
vocab_size
=
len
(
...
...
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