Skip to content

[Question]: CPU使用paddlenlp/PP-UIE-0.5B模型会报错 #11179

@sunfw2008

Description

@sunfw2008

请提出你的问题

执行代码
from pprint import pprint
from paddlenlp import Taskflow

schema = ['时间', '选手', '赛事名称'] # Define the schema for entity extraction
ie = Taskflow('information_extraction',
schema=['姓名', '身份证', '申请人公司', "受伤时间"
, '近亲属姓名及联系电话'],
schema_lang="zh",
batch_size=1,
model='paddlenlp/PP-UIE-0.5B',
device_id=-1,
device="cpu",
)
pprint(
ie("职业伤害保障伤残待遇申请表\n申请人:北京三有限公司联系电话:与受伤害新就业形态就业人员的关系:平台企业\n姓名\n性别\n男\n新就业形态就\n身份证件类型\n√居民身份证口其他\n身份证件号码\n\n业人员基本信息\n个人联系电话\n近亲属姓名及联系电话\n广州市白云区德田心\n受伤时间\n2024-11-02 17:07:00\n受伤地点\n职业伤害信息\n大路东约20米\n受伤害部位\n上肢\n诊断时间\n2024-11-02\n√社会保障卡(系统自动关联,不需提供)\n个人银行\n银行\n银行支行(分行)\n账号信息\n□其他账号\n户名\n账号\n平台企业名称\n北京三快在线科技有限公司\n平台企业服务机构名称\n重庆金纪有限公司\n企业经办人姓\n李洋\n名及联系电话\n美团众包骑手\n,在2024年11月02日16时02接到了美团平台订单\n新就业形态就\,广东省广州市荔湾区金花街道嘉城苑送餐至万科金域悦府-C7号楼\n业人员受伤害\n(2003)送餐结束返程时,于17:07左右途径路大路东约20附近,骑\n经过简述\n手驾驶电动车在送餐结束返程时,与机动车发生碰撞,导致骑手右侧尺骨干骨折,在广州市\n荔湾区中医医院治疗。\n请打“”确认:\n机构意见:\n√职业伤害确认\n√伤残长期待遇申请\n√伤残一次性待遇申请\n-\n申请事项\n□零星报销(非联网结算)医疗待遇申请\n山\n电子签药专用章\n胡久成\n申请人签名(按指印):\n2025年1月6日\n2025年1月6日\n申请:□医疗费用、□康复治疗费用、□辅助器具费用:\n票据总金额\n元,票据张数\n张;\n非联网结算\n其中:医疗保险基金垫付元,参保所属地市。\n(零星报销)\n医疗待遇\n申领填报\n胡久成\n申请人签名(按指印):\n2025年1月6日")) # Better print results using pprint

报错内容:
Downloading shards: 100%|██████████| 1/1 [00:00<00:00, 991.80it/s]
Traceback (most recent call last):
File "D:\software\miniconda3\envs\my_python_tools\lib\contextlib.py", line 135, in enter
return next(self.gen)
File "D:\software\miniconda3\envs\my_python_tools\lib\site-packages\paddlenlp\transformers\model_utils.py", line 285, in dtype_guard
paddle.set_default_dtype(dtype)
File "D:\software\miniconda3\envs\my_python_tools\lib\site-packages\paddle\framework\framework.py", line 72, in set_default_dtype
raise TypeError(
TypeError: set_default_dtype only supports [float16, float32, float64, bfloat16] , but received fp32

Metadata

Metadata

Assignees

Labels

questionFurther information is requested

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions