您当前的位置:首页 > IT编程 > TensorFlow
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 |

自学教程:Truncation was not explicitely activated but max_length is provided a specific value, please use tru

51自学网 2023-09-16 17:14:22
  TensorFlow
这篇教程Truncation was not explicitely activated but max_length is provided a specific value, please use tru写得很实用,希望能帮到您。

transformers.tokenization_utils_base

1.问题描述:

在使用Transformer或者SentenceTransformer时有时会遇到如下警告,甚是恼火!!!

2.错误:

WARNING:transformers.tokenization_utils_base:Truncation was not explicitely activated but max_length is provided a specific value, please use truncation=True to explicitely truncate examples to max length. Defaulting to ‘longest_first’ truncation strategy. If you encode pairs of sequences (GLUE-style) with the tokenizer you can select this strategy more precisely by providing a specific strategy to truncation.

3.解决方法:

import logging
logging.basicConfig(level=logging.ERROR)

4.特殊情况

当使用的是jupter notebook,添加完代码需要重启服务才可以哦!

返回列表
Could not load dynamic library 'libcudart.so.10.1'; dlerror: libcudart.so.10.1: cannot ope
51自学网自学EXCEL、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。
京ICP备13026421号-1