#10256·LlamaFactory

Cannot import name 'load_and_register_kernel' from 'transformers.integrations.hub_kernels'

Author: gxx27Created Mar 7, 2026Updated Sep 14, 2026
Labelsbugpending

Reminder

  • I have read the above rules and searched the existing issues.

System Info

  • llamafactory version: 0.9.5.dev0
  • Platform: Linux-6.8.0-41-generic-x86_64-with-glibc2.39
  • Python version: 3.11.15
  • PyTorch version: 2.10.0+cu128 (GPU)
  • Transformers version: 5.2.0
  • Datasets version: 4.0.0
  • Accelerate version: 1.11.0
  • PEFT version: 0.18.1
  • GPU type: NVIDIA A100 80GB PCIe
  • GPU number: 1
  • GPU memory: 79.25GB
  • TRL version: 0.24.0
  • Git commit: 9501c3308a01ecce03e952aadd10b509fa4e1411
  • Default data directory: detected

Reproduction

Hello, I want to use LlamaFactory to finetune gpt-oss-20b model using my data, however, when I use the command: llamafactory-cli train examples/train_lora/oss_20b_reasoning_lora.yaml, it told me cannot import the function from the package.

This error comes from the src/llamafactory/model/model_utils/attention.py line 35.

Can you tell me how to fix it?

Thank you for your attention and time!

Others

No response