Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question]: nlp最大支持的文本长度是多少呢,我自己抽取100多字的文本会报错 #9584

Open
dongyu6 opened this issue Dec 9, 2024 · 1 comment
Assignees
Labels
question Further information is requested

Comments

@dongyu6
Copy link

dongyu6 commented Dec 9, 2024

请提出你的问题

错误信息如下

/usr/local/lib/python3.10/dist-packages/paddlenlp/transformers/tokenizer_utils_base.py:1985: FutureWarning: The pad_to_max_length argument is deprecated and will be removed in a future version, use padding=True or padding='longest' to pad to the longest sequence in the batch, or use padding='max_length' to pad to a max length. In this case, you can give a specific length with max_length (e.g. max_length=45) or leave max_length to None to pad to the maximal input size of the model (e.g. 512 for Bert).
warnings.warn(
[{}]

代码如下
from paddlenlp import Taskflow

def uie_base(schema,text):
uie = Taskflow("information_extraction", schema=schema, model="uie-x-base")
result=uie(text)
return result

if name == 'main':
res=uie_base(
['题目'],
"""
2. 七年级(1)班同学开展了社会实践调查,
· 人们采集野生植物时掌握了一些可食用植物的生长规律,过实践,将它们培育为农作物。
· 人们开始将一些活的野兽或小动物图永起来,以备日后食用。
· 最初进行农业生产,主要是靠双手摇种和收获。后来人们仗用石刀等工具收割,用石磨盘加工
A. 家畜饲养的出现
B. 磨制石器的发展历程
C. 早期国家的出现
D. 原始农业的兴起发展
""")
print(res)

@dongyu6 dongyu6 added the question Further information is requested label Dec 9, 2024
@dongyu6
Copy link
Author

dongyu6 commented Dec 9, 2024

我是使用的
docker run --gpus all --name paddle_docker -v $PWD:/paddle --network=host -it registry.baidubce.com/paddlepaddle/paddle:3.0.0b1-gpu-cuda12.3-cudnn9.0-trt8.6 /bin/bash
命令创建的镜像,然后在镜像中使用以下命令安装 nlp

pip install --upgrade --pre paddlenlp

具体版本如下所示

paddle2onnx 1.3.1
paddlefsl 1.1.0
paddlenlp 3.0.0b2
paddlepaddle-gpu 3.0.0b1
x2paddle 1.5.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants