Skip to content

KeyError: 'rope_parameters_factor' when using convert_gpt_oss_weights_to_hf.py for openai/gpt-oss-20b #42003

@shubhagr-qc

Description

@shubhagr-qc

System Info

Transformer is on commit 64397a8 of main branch.
Latest as of Nov 4 2025

Who can help?

@zucchini-nlp
PR Introducing the key in the convert file is #39847
Can you please help with this issue.

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

Steps to reproduce the error:

  1. huggingface-cli download openai/gpt-oss-20b
  2. git clone https://github.com/huggingface/transformers.git
  3. cd transformers
  4. pip install -e .
  5. cd src/transformers/models/gpt_oss
  6. python convert_gpt_oss_weights_to_hf.py --input_dir modelsopenai-gpt-oss-20b/snapshots/2e8f8052ee2aeee907f76e08c08b9fdde8677ca8/original/ --output_dir ./gpt_oss_20b_fp16

Error:
Traceback (most recent call last):
File "/local/mnt/workspace/shubhagr/openAi/weightsConvert/transformers/src/transformers/models/gpt_oss/convert_gpt_oss_weights_to_hf.py", line 831, in
main()
File "/local/mnt/workspace/shubhagr/openAi/weightsConvert/transformers/src/transformers/models/gpt_oss/convert_gpt_oss_weights_to_hf.py", line 815, in main
write_model(
File "/local/mnt/workspace/shubhagr/openAi/weightsConvert/transformers/src/transformers/models/gpt_oss/convert_gpt_oss_weights_to_hf.py", line 163, in write_model
"factor": float(original_config.pop("rope_parameters_factor")),
KeyError: 'rope_parameters_factor'

Expected behavior

Expected it to complete successfully which is still happening if I revert the mentioned commit.

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