Skip to content

[Bug]: TypeError: 'type' object is not subscriptable #9775

Open
@BaolanChen

Description

软件环境

-paddle2onnx:              1.1.0
-paddlefsl:                1.1.0
-paddlenlp:                3.0.0b3
-paddlepaddle-gpu:         3.0.0rc0

重复问题

  • I have searched the existing issues

错误描述

在百度AI Studio环境中开发项目,开发环境: paddle dev gpu-cuda11.8-cudnn8

安装paddlenlp后,并import paddlenlp使用,这时出现报错,如下所示

>>> import paddlenlp
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/aistudio/.local/lib/python3.8/site-packages/paddlenlp/__init__.py", line 46, in <module>
    from . import (
  File "/home/aistudio/.local/lib/python3.8/site-packages/paddlenlp/trl/__init__.py", line 21, in <module>
    from .sft_config import *
  File "/home/aistudio/.local/lib/python3.8/site-packages/paddlenlp/trl/sft_config.py", line 29, in <module>
    class SFTConfig(TrainingArguments):
  File "/home/aistudio/.local/lib/python3.8/site-packages/paddlenlp/trl/sft_config.py", line 62, in SFTConfig
    model_init_kwargs: Optional[dict[str, Any]] = None
TypeError: 'type' object is not subscriptable

稳定复现步骤 & 代码

  1. AI Studio开发环境: paddle dev gpu-cuda11.8-cudnn8

  2. 安装paddle命令:
    python -m pip install paddlepaddle-gpu==3.0.0rc0 -i https://www.paddlepaddle.org.cn/packages/stable/cu118/

  3. 安装paddlenlp命令:
    pip install --upgrade paddlenlp==3.0.0b3

  4. 使用paddlenlp后报错,如图所示:

ec9afcd8757f0a90139e393039081a9

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions