遇到的问题
加载Meta-Llama-3-8B-Instruct模型时出错,一直无法解决
ValueError: .to is not supported for 4-bit or 8-bit bitsandbytes models. Please use the model as it is, since the model has already been set to the correct devices and casted to the correct dtype.
操作环境、软件版本等信息
bitsandbytes 0.45.0
torch 2.1.2
torchvision 0.16.2+cu118
# bitsandbytes parameters
use_4bit = True # Activate 4-bit precision base model loading
bnb_4bit_compute_dtype = "float16" # Compute dtype for 4-bit base models
bnb_4bit_quant_type = "nf4" # Quantization type (fp4 or nf4)
use_nested_quant = False # Activate nested quantization for 4-bit base models (double quantization)
# Load base model
model = AutoModelForCausalLM.from_pretrained(
pretrained_model_name_or_path=model_name,
quantization_config=bnb_config,
device_map="auto"
)
尝试禁用4位量化等等仍然是这个报错,不太明白为什么,求解答