[logging] implement warning_advice / TRANSFORMERS_NO_ADVISORY_WARNINGS (#14669)

* [logging] implement warning_advice / TRANSFORMERS_NO_ADVISORY_WARNINGS

* reword
This commit is contained in:
Stas Bekman
2021-12-20 20:48:38 -08:00
committed by GitHub
parent c1125dc2ba
commit b6ec956976
4 changed files with 44 additions and 3 deletions

View File

@@ -1937,7 +1937,7 @@ class PreTrainedTokenizerBase(SpecialTokensMixin, PushToHubMixin):
# Check all our special tokens are registered as "no split" token (we don't cut them) and are in the vocab
added_tokens = tokenizer.sanitize_special_tokens()
if added_tokens:
logger.warning(
logger.warning_advice(
"Special tokens have been added in the vocabulary, make sure the associated word embeddings are fine-tuned or trained."
)