from llama_cpp import Llama model = Llama(model_path="llama-2-7b-chat.ggmlv3.q4_0.bin")
錯誤:gguf_init_from_file: invalid magic characters 'tjgg'等,也就是無法加載模型
因為最新版的llama-cpp-python不支持ggml文件格式了
解決方案:
1、降低版本(最簡單):
pip install llama-cpp-python==0.1.78
2、直接下載對應(yīng)GGUF的模型
3、利用llama.cpp內(nèi)部轉(zhuǎn)換函數(shù)進行轉(zhuǎn)換
參考出處:TheBloke/Llama-2-13B-GGML · Could not load Llama model from path (huggingface.co)
運行結(jié)果:文章來源:http://www.zghlxwxcb.cn/news/detail-808175.html
文章來源地址http://www.zghlxwxcb.cn/news/detail-808175.html
到了這里,關(guān)于大模型在cpu上使用llama_cpp部署無法加載模型的問題的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!