reduce verbosity of the special tokens (#1472)
Browse files
src/axolotl/utils/models.py
CHANGED
@@ -43,6 +43,7 @@ from axolotl.prompt_tokenizers import LLAMA_DEFAULT_EOS_TOKEN
|
|
43 |
from axolotl.utils.bench import log_gpu_memory_usage
|
44 |
from axolotl.utils.chat_templates import chat_templates
|
45 |
from axolotl.utils.dict import DictDefault
|
|
|
46 |
from axolotl.utils.lora_embeddings import get_linear_embedding_layers
|
47 |
|
48 |
LOG = logging.getLogger("axolotl")
|
@@ -247,10 +248,11 @@ def load_tokenizer(cfg):
|
|
247 |
{"additional_special_tokens": additional_special_tokens}
|
248 |
)
|
249 |
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
|
|
254 |
|
255 |
if cfg.chat_template:
|
256 |
chat_template_string = chat_templates(cfg.chat_template)
|
@@ -435,6 +437,7 @@ def load_model(
|
|
435 |
|
436 |
if cfg.revision_of_model:
|
437 |
model_kwargs["revision"] = cfg.revision_of_model
|
|
|
438 |
if cfg.gptq:
|
439 |
if not hasattr(model_config, "quantization_config"):
|
440 |
LOG.warning("model config does not contain quantization_config information")
|
|
|
43 |
from axolotl.utils.bench import log_gpu_memory_usage
|
44 |
from axolotl.utils.chat_templates import chat_templates
|
45 |
from axolotl.utils.dict import DictDefault
|
46 |
+
from axolotl.utils.distributed import zero_only
|
47 |
from axolotl.utils.lora_embeddings import get_linear_embedding_layers
|
48 |
|
49 |
LOG = logging.getLogger("axolotl")
|
|
|
248 |
{"additional_special_tokens": additional_special_tokens}
|
249 |
)
|
250 |
|
251 |
+
with zero_only():
|
252 |
+
LOG.debug(f"EOS: {tokenizer.eos_token_id} / {tokenizer.eos_token}")
|
253 |
+
LOG.debug(f"BOS: {tokenizer.bos_token_id} / {tokenizer.bos_token}")
|
254 |
+
LOG.debug(f"PAD: {tokenizer.pad_token_id} / {tokenizer.pad_token}")
|
255 |
+
LOG.debug(f"UNK: {tokenizer.unk_token_id} / {tokenizer.unk_token}")
|
256 |
|
257 |
if cfg.chat_template:
|
258 |
chat_template_string = chat_templates(cfg.chat_template)
|
|
|
437 |
|
438 |
if cfg.revision_of_model:
|
439 |
model_kwargs["revision"] = cfg.revision_of_model
|
440 |
+
|
441 |
if cfg.gptq:
|
442 |
if not hasattr(model_config, "quantization_config"):
|
443 |
LOG.warning("model config does not contain quantization_config information")
|