Typo
This commit is contained in:
parent
65f754e0f4
commit
e4205ffad5
2 changed files with 8 additions and 8 deletions
|
|
@ -613,10 +613,10 @@ def patch_tokenizer(model, tokenizer):
|
|||
|
||||
# Edit all config with new pad token
|
||||
current_model = model
|
||||
while hasattr(model, "model") and hasattr(model, "config"):
|
||||
while hasattr(current_model, "model") and hasattr(current_model, "config"):
|
||||
current_model.config.update({"pad_token_id" : tokenizer.pad_token_id})
|
||||
current_model = current_model.model
|
||||
if hasattr(model, "model") and hasattr(model, "config"):
|
||||
if hasattr(current_model, "model") and hasattr(current_model, "config"):
|
||||
current_model.config.update({"pad_token_id" : tokenizer.pad_token_id})
|
||||
pass
|
||||
|
||||
|
|
@ -630,10 +630,10 @@ def patch_tokenizer(model, tokenizer):
|
|||
|
||||
# Edit all config with new pad token
|
||||
current_model = model
|
||||
while hasattr(model, "model") and hasattr(model, "config"):
|
||||
while hasattr(current_model, "model") and hasattr(current_model, "config"):
|
||||
current_model.config.update({"pad_token_id" : tokenizer.pad_token_id})
|
||||
current_model = model
|
||||
if hasattr(model, "model") and hasattr(model, "config"):
|
||||
if hasattr(current_model, "model") and hasattr(current_model, "config"):
|
||||
current_model.config.update({"pad_token_id" : tokenizer.pad_token_id})
|
||||
pass
|
||||
|
||||
|
|
|
|||
|
|
@ -1849,12 +1849,12 @@ class FastLlamaModel:
|
|||
|
||||
# Fix up all vocab sizes
|
||||
current_model = model
|
||||
while hasattr(model, "model") and hasattr(model, "config"):
|
||||
if hasattr(model.config, "vocab_size"):
|
||||
while hasattr(current_model, "model") and hasattr(current_model, "config"):
|
||||
if hasattr(current_model.config, "vocab_size"):
|
||||
current_model.config.update({"vocab_size" : len(tokenizer)})
|
||||
current_model = current_model.model
|
||||
if hasattr(model, "model") and hasattr(model, "config"):
|
||||
if hasattr(model.config, "vocab_size"):
|
||||
if hasattr(current_model, "model") and hasattr(current_model, "config"):
|
||||
if hasattr(current_model.config, "vocab_size"):
|
||||
current_model.config.update({"vocab_size" : len(tokenizer)})
|
||||
pass
|
||||
pass
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue