欢迎来到尧图网

客户服务 关于我们

您的位置:首页 > 财经 > 创投人物 > 源码方式安装llama.cpp及调试

源码方式安装llama.cpp及调试

2025/2/25 1:44:32 来源:https://blog.csdn.net/goodgood_UP/article/details/145736378  浏览:    关键词:源码方式安装llama.cpp及调试

llama.cpp源码方式安装和调试配置

构建和编译

  • 注意这里是cuda,且要开启debug模式
cmake -B build -DGGML_CUDA=ON -DCMAKE_BUILD_TYPE=Debug
cmake --build build --config Debug
  • 正在编译:
    在这里插入图片描述

配置launch.json用于调式:

要根据自己的环境路径做相应修改

{"version": "0.2.0","configurations": [{"name": "(gdb) 启动","type": "cppdbg","request": "launch","program": "${workspaceFolder}/build/bin/llama-simple", // "args": [    // "-m", "output.gguf","-n", "32","-ngl", "99","Hello my name is" ],"stopAtEntry": false,"cwd": "${workspaceFolder}","environment": [],"externalConsole": false,"MIMode": "gdb", // "setupCommands": [{"description": "为 gdb 启用整齐打印","text": "-enable-pretty-printing","ignoreFailures": true},{"description": "将反汇编风格设置为 Intel","text": "-gdb-set disassembly-flavor intel","ignoreFailures": true}],"miDebuggerPath": "/usr/bin/gdb" // }]
}

转换模型为gguf格式

python convert_hf_to_gguf.py --outtype f16 --outfile "output.gguf" "/raid/home/huafeng/models/Meta-Llama-3-8B-Instruct"

运行第一个程序

在这里插入图片描述

调试程序(llama.cpp/examples/simple/simple.cpp)

在这里插入图片描述

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

热搜词