PaddlePaddle / PaddleNLP

👑 Easy-to-use and powerful NLP and LLM library with 🤗 Awesome model zoo, supporting wide-range of NLP tasks from research to industrial applications, including 🗂Text Classification, 🔍 Neural Search, ❓ Question Answering, ℹ️ Information Extraction, 📄 Document Intelligence, 💌 Sentiment Analysis etc.
https://paddlenlp.readthedocs.io
Apache License 2.0
12.11k stars 2.94k forks source link

[Bug]: ValueError:(InvalidArgument) Variable value (input) of OP(fluid.layers.embeding) expected >=0 and < 40000, but got 236693.please check input value. #6398

Open weizhognxing opened 1 year ago

weizhognxing commented 1 year ago

软件环境

paddle-bfloat            0.1.7
paddle2onnx              1.0.6
paddlefsl                1.1.0
paddlenlp                2.5.2
paddlepaddle             2.4.2
paddlepaddle-gpu         2.4.2

重复问题

错误描述

运行中文相关的UIE模型没有报错,只有运行英文相关的模型才会报错,例如:uie-base-en、uie-m-large、uie-m-base

稳定复现步骤 & 代码

from pprint import pprint from paddlenlp import Taskflow import json import pandas as pd import os

schema = ['target']

my_ie = Taskflow("information_extraction", schema=schema,task_path='uie-m-base') zh_target_path="/data/NLP/test/wei-test/hotnews_en"

outfile="/data/NLP/test/wei-test/medical_rs/test_target_test100_base_en.xlsx" text_list=[] ba_list=[] yaoming_list=[]

index=0 for x in os.listdir(zh_target_path): content_text=open(zh_target_path+"/"+x,"r").read() js_arr_dict=my_ie("I love you. many man,many many many man!girls,i love girls!")

if "target" in js_arr_dict[0]:
    badian=""
    for x in js_arr_dict[0]['target']:
        badian=x["text"]+","+badian
    ba_list.append(badian)
else:
    ba_list.append("")
text_list.append(content_text)
index=index+1

result_excel = pd.DataFrame() result_excel["文本"] = text_list result_excel["target"] = ba_list result_excel.to_excel(outfile)

w5688414 commented 6 months ago

请提供一下您代码里面的文件。

zh_target_path="/data/NLP/test/wei-test/hotnews_en"