警告内容:
"clean_up_tokenization_spaces was not set. It will be set to True by default. This behavior will be deprecated in transformers v4.45, and will be then set to False by default. For more details check this issue: https://github.com/huggingface/transformers/issues/31884"
解释:
clean_up_tokenization_spaces 是 Transformers 库中用于控制文本去掉多余空格的参数。当进行分词(tokenization)和去词干化(detokenization)操作时,设置此参数可以影响最终生成文本的格式:
True:会去除分词过程中可能引入的多余空格,使生成的文本更具可读性。False:不会去除这些空格,保留原始分词后的空格格式。
当前行为与未来变化
-
当前默认行为:如果不显式设置
clean_up_tokenization_spaces,Transformers 默认会将其设置为True,即会自动清理多余空格。 -
未来默认行为(transformers v4.45 及以后):默认值将变为
False,即不再自动清理多余空格。这可能会影响到文本的格式,尤其是在生成或处理文本时。



















