unsloth错误
0
错误如下:
Skipping import of cpp extensions due to incompatible torch version. Please upgrade to torch >= 2.11.0 (found 2.10.0+cu128).
/data/conda/anaconda3/envs/ai/lib/python3.12/site-packages/unsloth/__init__.py:165: UserWarning: WARNING: Unsloth should be imported before [trl, transformers, peft] to ensure all optimizations are applied. Your code may run slower or encounter memory issues without these optimizations.
Please restructure your imports with 'import unsloth' at the top of your file.
from ._gpu_init import *
🦥 Unsloth: Will patch your computer to enable 2x faster free finetuning.
🦥 Unsloth Zoo will now patch everything to make training faster!
==((====))== Unsloth 2026.6.1: Fast Qwen2 patching. Transformers: 4.57.2.
\\ /| Tesla V100-PCIE-16GB. Num GPUs = 1. Max memory: 15.766 GB. Platform: Linux.
O^O/ \_/ \ Torch: 2.10.0+cu128. CUDA: 7.0. CUDA Toolkit: 12.8. Triton: 3.6.0
\ / Bfloat16 = FALSE. FA [Xformers = 0.0.35. FA2 = False]
"-____-" Free license: http://github.com/unslothai/unsloth
Unsloth: Fast downloading is enabled - ignore downloading bars which are red colored!
Unsloth 2026.6.1 patched 28 layers with 28 QKV layers, 28 O layers and 28 MLP layers.
Traceback (most recent call last):
File "/data/ai/sft/stock_sft.py", line 69, in <module>
trainer = SFTTrainer(
^^^^^^^^^^^
TypeError: SFTTrainer.__init__() got an unexpected keyword argument 'packing'
这个不是版本问题,而是脚本必须先导入unsloth,即使没有使用也要先导入import unsloth。