当前位置: 首页 > news >正文

llama.cpp demo

git clone https://github.com/ggerganov/llama.cpp
cd llama.cpp

修改Makefile使能mfma参数

    MK_CFLAGS   += -mfma -mf16c -mavx
    MK_CXXFLAGS += -mfma -mf16c -mavx

安装python3依赖

cat ./requirements/requirements-convert_legacy_llama.txt

numpy~=1.26.4
sentencepiece~=0.2.0
transformers>=4.40.1,<5.0.0
gguf>=0.1.0
protobuf>=4.21.0,<5.0.0

依次pip3 install numpy/pip3 install sentencepiece/pip3 install transformers/pip3 install gguf/pip3 install protobuf

下载https://huggingface.co/4bit/Llama-2-7b-chat-hf

转换出llama-2-7b-chat.gguf

python3 convert_hf_to_gguf.py ./models/Llama-2-7b-chat-hf --outfile llama-2-7b-chat.gguf

启动

./llama-cli -m ./llama-2-7b-chat.gguf  -co -cnv -p "You are a helpful assistant."  -fa -ngl 80 -n 512

即可开始对话

== Running in interactive mode. ==
 - Press Ctrl+C to interject at any time.
 - Press Return to return control to the AI.
 - To return control without starting a new line, end your input with '/'.
 - If you want to submit another line, end your input with '\'.

 <|im_start|>system
You are a helpful assistant.<|im_end|>

> hello
Hello! How can I help you today?
<|im_end|>

>
tell me about yourself
<|im_end|>

> can you speek Chinese ?
I apologize, but I don't speak Chinese. I'm just an AI trained to assist and provide helpful responses in English. Is there anything else I can help you with?
<|im_end|>

>


另外看看是不是可以直接下载 llama-2-7b-chat.gguf

https://huggingface.co/TheBloke/Llama-2-7B-Chat-GGUF/tree/main

http://www.lryc.cn/news/435864.html

相关文章:

  • OpenCV结构分析与形状描述符(19)查找二维点集的最小面积外接旋转矩形函数minAreaRect()的使用
  • [SWPU2019]Web1 超详细教程
  • 【区块链通用服务平台及组件】基于向量数据库与 LLM 的智能合约 Copilot
  • mfc140u.dll丢失有啥方法能够进行修复?分享几种mfc140u.dll丢失的解决办法
  • 【PyQt6 应用程序】在用户登录界面实现密码密文保存复用
  • 赋能百业:多模态处理技术与大模型架构下的AI解决方案落地实践
  • 游戏论坛网站|基于Springboot+vue的游戏论坛网站系统游戏分享网站(源码+数据库+文档)
  • 【go】pprof 性能分析
  • Python | Leetcode Python题解之第397题整数替换
  • JDBC使用
  • 633. 平方数之和-LeetCode(C++)
  • Linux shell编程学习笔记79:cpio命令——文件和目录归档工具(下)
  • 《 C++ 修炼全景指南:七 》优先级队列在行动:解密 C++ priority_queue 的实现与应用
  • 通信工程学习:什么是HSS归属用户服务器
  • mysql workbench 如何访问远程数据库
  • ICMAN触摸感应芯片方案
  • 面向个小微型企业的开源大模型(Qwen2等)商业化, AI部署成本分析与优化策略(费用分析、资源消耗分析)
  • pandas判断一列中存在nan值
  • 如何将 Electron 项目上架 Apple Store
  • R语言统计分析——功效分析2(t检验,ANOVA)
  • android 侧滑返回上一界面备忘
  • golang学习笔记18——golang 访问 mysql 数据库全解析
  • 苹果账号登录后端验证两种方式 python2
  • FlinkCDC 3.2.0 新增优点 Pattern Replacement in routing rules
  • 《 C++ 修炼全景指南:六 》深入探索 C++ 标准库中的 stack 与 queue 容器适配器
  • 高级java每日一道面试题-2024年9月07日-JVM篇-说一下类加载的执行过程?
  • 笔试强训day09
  • 软件测试中的黑盒测试方法,包括其定义、目的及主要步骤。
  • Shell脚本计算π的近似值
  • 进程间通信之消息队列