Skip to content

ImportError: cannot import name 'GptOssForSequenceClassification' from 'transformers' #40468

@pervaizniazi

Description

@pervaizniazi

System Info

Pytorch version: 2.8.0+cu128
Transformers version: 4.55.4

Who can help?

Hi,

I have uninstalled a latest version of transformers. While accessing "GptOssForSequenceClassification", I get the error:

ImportError: cannot import name 'GptOssForSequenceClassification' from 'transformers' (/home/user/miniconda3/envs/working/lib/python3.10/site-packages/transformers/init.py). @ArthurZucker

Information

  • The official example scripts
  • My own modified scripts

Tasks

  • An officially supported task in the examples folder (such as GLUE/SQuAD, ...)
  • My own task or dataset (give details below)

Reproduction

from transformers import GptOssForSequenceClassification

mdir='/home/user/gpt-oss-20b/'
model = GptOssForSequenceClassification.from_pretrained(mdir, [trust_remote_code=True)]
print(model)

Expected behavior

GptOssForSequenceClassification should be imported successfully.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions