运行时错误:无法导入transformers.integrations.bitsandbytes

问题描述 投票:0回答:1

我正在尝试以 4 位精度加载 llm 模型。但是,我收到 RuntimeError: Failed to import Transformers.integrations.bitsandbytes 因为以下错误(查找其回溯): [WinError 193] 运行以下代码后,%1 不是有效的 Win32 应用程序:

#device_map = {"": 0}

model = AutoModelForCausalLM.from_pretrained(model_id, 
                                             device_map= "auto", 
                                             quantization_config=quantization_config,
                                             token=ACCESS_TOKEN)
model.eval()
device = 'cuda' if torch.cuda.is_available() else 'cpu'

我已经安装了加速、bitsandbytes、变压器和所有其他软件包,但我仍然遇到相同的错误。

我在回溯中看到的唯一东西是 OSError。

我也重启了内核,但还是不行。

请帮我解决这个问题。谢谢!

deep-learning nlp huggingface-transformers large-language-model
1个回答
0
投票

BitsAndBytes 与基于 Windows 的系统不兼容。有一个特定的分支并不总是保证能正常工作,但它实际上在 Linux 中受支持,您应该切换到 Ubuntu 以避免错误。

© www.soinside.com 2019 - 2024. All rights reserved.