You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I found the tokenizer_config.json -> model_max_length does not update when model_args.model_max_length (equals to cutoff_len) is changed.
The cause may from the model/loader.py:
defload_tokenizer(model_args: "ModelArguments") ->"TokenizerModule":
r""" Loads pretrained tokenizer and optionally loads processor. Note: including inplace operation of model_args. """init_kwargs=_get_init_kwargs(model_args)
config=load_config(model_args)
try:
tokenizer=AutoTokenizer.from_pretrained(
model_args.model_name_or_path,
use_fast=model_args.use_fast_tokenizer,
split_special_tokens=model_args.split_special_tokens,
padding_side="right",
**init_kwargs,
)
exceptValueError: # try the fast onetokenizer=AutoTokenizer.from_pretrained(
model_args.model_name_or_path,
use_fast=True,
padding_side="right",
**init_kwargs,
)
exceptExceptionase:
raiseOSError("Failed to load tokenizer.") frome
...
Here the tokenizer loads by model_name_or_path, but the model_max_length is not configured from model_args.
Expected behavior
I don't know if the tokenizer.model_max_length would be configured elsewhere. But passing the arg during the tokenizer creation process still make sense.
Others
No response
The text was updated successfully, but these errors were encountered:
Reminder
System Info
llamafactory version: 0.9.2.dev0
Platform: Linux-5.15.0-91-generic-x86_64-with-glibc2.35
Python version: 3.10.15
PyTorch version: 2.5.1+cu124 (GPU)
Transformers version: 4.46.1
Datasets version: 3.1.0
Accelerate version: 1.0.1
PEFT version: 0.12.0
TRL version: 0.9.6
GPU type: NVIDIA H100 80GB HBM3
DeepSpeed version: 0.15.4
Reproduction
I found the
tokenizer_config.json -> model_max_length
does not update whenmodel_args.model_max_length
(equals tocutoff_len
) is changed.The cause may from the
model/loader.py
:Here the tokenizer loads by
model_name_or_path
, but themodel_max_length
is not configured frommodel_args
.Expected behavior
I don't know if the
tokenizer.model_max_length
would be configured elsewhere. But passing the arg during the tokenizer creation process still make sense.Others
No response
The text was updated successfully, but these errors were encountered: