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

ops/2025/2/22 4:37:58/

llamacpp_0">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"

运行第一个程序

在这里插入图片描述

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

在这里插入图片描述


http://www.ppmy.cn/ops/160426.html

相关文章

HttpServletRequest

在 Spring 框架中,HttpServletRequest 和 RequestBody JSONObject 是两种常见的参数注入方式,用于处理 HTTP 请求的数据。 1. HttpServletRequest servletRequest HttpServletRequest 是 Java Servlet API 中的一个接口,Spring MVC 中也使用…

基于 Spring Boot + 微信小程序的短文写作竞赛管理系统设计与实现(源码+文档)

大家好,今天要和大家聊的是一款基于 Spring Boot 微信小程序的“短文写作竞赛管理系统”的设计与实现。项目源码以及部署相关事宜请联系我,文末附上联系方式。 项目简介 基于 Spring Boot 微信小程序的“短文写作竞赛管理系统”设计与实现的主要使用…

LINUX安装使用Redis

参考 Install Redis on Linux | Docs 安装命令 sudo apt-get install -y lsb-release curl gpgcurl -fsSL https://packages.redis.io/gpg | sudo gpg --dearmor -o /usr/share/keyrings/redis-archive-keyring.gpgsudo chmod 644 /usr/share/keyrings/redis-archive-keyrin…

AI、Java、C++、C#等技术学习资源链接汇总

AI、Java、C、C#等技术学习资源链接汇总 一、AI学习资源 AIGC知识库:一站式人工智能知识库 链接:AI知识库 语雀 AI创业知识库 链接:Docs Learn Prompt(免费&支持中英切换) 链接:Learn Prompt: Your …

pytorch cnn 实现猫狗分类

文章目录 [toc] 1. 导入必要的库2. 定义数据集类3. 数据预处理和加载4. 定义 CNN 模型5. 定义损失函数和优化器6. 训练模型7. 保存模型8. 使用模型进行预测9 完整代码10. 总结 1. 导入必要的库 import torch import torch.nn as nn import torch.optim as optim from torch.ut…

管理WSL实例 以及安装 Ubuntu 作为 WSL 子系统 流程

安装ubuntu wsl --install -d Ubuntu分类命令说明安装相关wsl --install在 Windows 10/11 上以管理员身份在 PowerShell 中运行此命令&#xff0c;可安装 WSLwsl --install -d <distribution name>在 PowerShell 中使用此命令安装特定版本的 Linux 发行版&#xff0c;如…

HTTP.

HTTP主要讲一下状态码和缓存机制 1xx 类状态码属于提示信息&#xff0c;是协议处理中的一种中间状态&#xff0c;如http升级为websocket&#xff0c;会提示1xx 2xx 类状态码表示服务器成功处理了客户端的请求 「200 OK」是最常见的成功状态码「204 No Content」也是常见的成功…

DCA考试备考

目录标题 考试内容指南一、考试环境准备&#xff08;一&#xff09;创建单实例数据库&#xff08;二&#xff09;管理数据库对象 二、数据操作&#xff08;一&#xff09;数据导入&#xff08;二&#xff09;参数修改 三、备份与恢复&#xff08;一&#xff09;备份&#xff08…