大模型部署手记(8)LLaMa2+Windows+llama.cpp+英文文本补齐

news2024/9/27 9:20:40

1.简介:

组织机构:Meta(Facebook)

代码仓:https://github.com/facebookresearch/llama

模型:llama-2-7b

下载:使用download.sh下载

硬件环境:暗影精灵7Plus

Windows版本:Windows 11家庭中文版 Insider Preview 22H2

内存 32G

GPU显卡:Nvidia GTX 3080 Laptop (16G)

2.代码和模型下载:

下载llama.cpp的代码仓:

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

需要获取原始LLaMA的模型文件,放到 models目录下,现在models目录下是这样的:

参考 https://blog.csdn.net/snmper/article/details/133578456

将上次在Jetson AGX Orin上的成功运行的7B模型文件传到 models目录下:

3.llama.cpp环境安装:

查看readme,找到llamp.cpp在Windows上的安装方式

打开 https://github.com/skeeto/w64devkit/releases

找到最新fortran版本的 w64devkit:

下载完成后系统弹出:

往前找一个版本v.19.0试试:https://github.com/skeeto/w64devkit/releases/tag/v1.19.0

解压到 D:\w64devkit

运行 w64devkit.exe

切换到 d: 盘

cd llama.cpp

python -V

这里python是3.7.5版本。

查看下make,cmake,gcc,g++的版本:

编译试试:

make

耐心等待编译结束(或者编译出错)

这个到底算不算恶意软件呢?

张小白感觉不像,于是到llama.cpp的官方去提了个issue确认一下:https://github.com/ggerganov/llama.cpp/issues/3463

官方回答如下:https://github.com/ggerganov/llama.cpp/discussions/3464

张小白还是决定使用 w64devkit,而且是最新版。在编译期间关掉 360杀毒软件!!!(其实还得关闭360安全卫士)

重新打开 https://github.com/skeeto/w64devkit/releases

下载 w64devkit-fortran-1.20.0.zip

解压到D盘:

双击运行 w64devkit.exe

cd d:/

cd llama.cpp

make

耐心等待编译结束:

编译成功。

其中exe就是生成好的windows可执行文件。

退出 w64devkit.编译环境。

4.安装依赖

创建conda环境

conda create -n llama python=3.10

conda activate llama

cd llama.cpp

pip install -r requirements.txt

5.部署验证

阅读下面这段内容:

将7B模型(14G左右)转换成 ggml FP16模型

python convert.py models/7B/

模型写到了 models\7B\ggml-model-f16.gguf 文件中:也是14G左右。

将刚才转换好的FP16模型进行4-bit量化:

./quantize ./models/7B/ggml-model-f16.gguf ./models/7B/ggml-model-q4_0.gguf q4_0

量化后的文件为:./models/7B/ggml-model-q4_0.gguf

大小只有3.8G了。

进行推理:

./main -m ./models/7B/ggml-model-q4_0.gguf -n 128

运行结果如下:

Refresh your summer look with our stylish new range of women's swimwear. Shop the latest styles in bikinis, tankinis and one pieces online at Simply Beach today! Our collection offers a wide selection of flattering designs from classic cuts to eye-catching prints that will turn heads on your next day by the pool. [end of text]

这个貌似是随机生成的一段话。

换个提示词: ./main -m ./models/7B/ggml-model-q4_0.gguf --prompt "Once upon a time"

补齐的文字如下:

Once upon a time, there was no such thing as a "social network". The idea of connecting with someone else on the Internet simply by clicking on their name and seeing who they were connected to and what we might have in common is a relatively new concept. But this kind of connection has become so much a part of our lives that we don't even think twice about it, right?
But once upon a time there was only one way to connect with someone: you either knew them or you didn't. And if you met somebody and became friends, the way you maintained your relationship was to stay in touch by phone, letter, or in person. It wasn't that easy before e-mail, cell phones, Facebook, Twitter, texting, and all the other ways we keep in touch today.
So I say once upon a time because social networking is not quite as new as it seems to be. In fact, I think the first true social network was formed back in 1594 when Shakespeare's "Hamlet" premiered at London's Globe Theatre and his performance was greeted by thunderous applause and a standing ovation by the entire audience.
At that time there were no movie theatre chains to advertise, no TV shows, no radio stations or even newspapers with paid reviews to promote "Hamlet" in advance of its opening night. Shakespeare's only way to get the word out about his latest production was through a series of "word-of-mouth" conversations between the people who had gone to see it and all those they encountered afterwards.
This was, by far, the most advanced social network that existed up until that time! And yet this type of social networking is probably still used today in the modern theatre world where actors and producers meet with audience members after their show to get feedback on how well (or not) it went over for them.
What we now call "social networking" is nothing more than the latest iteration of a centuries-old system that's already proven itself to be effective, but only when used by those who choose to engage in it voluntarily and without coercion. And yes, I realize that this particular definition of social networking has changed over time as well: from Shakespeare's "word of mouth" all the way up to the first online bulletin board systems (BBS) with 300-baud modems.
And yet, the latest innovation in social networking, Web 2.0 and its accompanying sites like Facebook, Twitter and LinkedIn still have yet to surpass these earlier methods in the minds of those who prefer not to use them (and they exist by virtue of an ever-growing user base).
So why is it that so many people are afraid of social networking? After all, there's no reason for anyone to feel compelled or coerced into joining these sites. And yet, despite this fact, a growing number of people seem more than willing to give up their personal information and privacy on the Internet. Why is that?
The answer is simple: most people don't have an accurate picture of what social networking really means. What they imagine it looks like bears little resemblance to how these sites actually work, let alone what's actually going on behind the scenes.
In a nutshell, those who believe that Web 2.0 is nothing but another attempt at getting us all "connected" are missing out on something very important: social networking isn't really about connecting with other people (much like Facebook and LinkedIn) or exchanging information (like Twitter). It's actually about the things we do when we connect, exchange information and interact.
So what does this mean? Simply put, all of these sites are ineffective at helping us get to know each other better. They have very little influence on how we choose who to trust or not to trust among our personal networks. What they're actually good for is gathering data (or information) about us as a way to sell us things that we don't really need and might not even want.
This isn't an attack on social networking, it's just the truth. Facebook may have started out as a site where students can connect with each other but it has now evolved into something much more sinister: a database of personal information about every one of its users that can be sold to anyone at any time without your consent (or even knowledge).
In effect, sites like LinkedIn and Facebook are nothing but the modern version of the old fashioned "spammers" who used to send us junk email. In addition to their obvious privacy concerns and their inability to help us connect with each other or exchange information, these social networking sites should also be regarded as a direct threat to our personal safety.
Why? Well, for one thing the information that they collect about us (and sell to others) can also be used by criminals to commit fraud against us and even extort money from us. This is why it's so important that we take control of this information and use it wisely instead of letting these sites control our private lives for their own selfish reasons.
The reality is that these sites cannot be trusted with the kind of personal information that they require about each one of us. Sites like LinkedIn or Facebook are nothing more than a threat to our privacy and should be regarded as such by every single person who uses them. In fact, sites like this (and any others) are in effect "spammers" who use the same tactics that spammers used to use in order to scam us into using their services.
I don't have a Facebook account and I don't plan on ever creating one either. This site is actually nothing more than a direct threat to my privacy because it uses the same old trick of collecting personal information about me (without my permission) in order to spam me with ads that will help them get rich at my expense. They have even resorted to using psychological tricks and sophisticated surveys in order to manipulate our feelings into believing that they are something important to us.
The truth is that sites like Facebook (or LinkedIn) can only be trusted if we're the ones who control them instead of letting others control them so that they can profit from it. In fact, a site like this can never even hope to become our friend because it doesn't respect the privacy rights of its users at all. This is why I am against these sites and their invasive surveys but if you want to know more about how these sites work then check out the link that we have below in order to learn a bit more about these sites. [end of text]

由于llama原始模型都是英文回答(后面会考虑试验改进后的中文),有请词霸翻译一下:

先试验到这里吧!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1078739.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

制药企业纯化水设备的应用及维护:设备健康管理软件的关键作用

纯化水设备在制药企业中扮演着重要角色,为生产高纯度水提供支持。然而,为了确保设备的可靠性和稳定性,有效的维护和管理至关重要。设备健康管理软件PreMaint成为实现这一目标的关键工具。本文将介绍PreMaint软件如何优化纯化水设备的维护&…

Qt_C++读写FM1208 CPU卡源码、支持windows、Linux系统

本示例使用的发卡器&#xff1a; Android Linux RFID读写器NFC发卡器WEB可编程NDEF文本/智能海报/-淘宝网 (taobao.com) #include "mainwindow.h" #include "./ui_mainwindow.h" #include <QDebug> #include "QLibrary" #include "Q…

政府部门搭建的数字化工具平台有哪些?

政府部门搭建的数字化工具平台多样且广泛&#xff0c;旨在提高行政效能、优化公共服务和促进政务创新。以下是一些常见的数字化工具平台及其功能的详细介绍。 一、电子政务平台 1. 政务门户网站&#xff1a;作为政府对外的窗口&#xff0c;提供政府机构、政策信息、在线办事、…

Redis 的过期键 | Navicat 技术干货

Redis 是一种高性能的内存数据存储&#xff0c;以其速度和多功能性而闻名。其中一个有用的特性是为键设置过期时间的功能。在 Redis 中&#xff0c;为键设置过期时间对于管理数据和确保过时或临时数据自动从数据库中删除是至关重要的。在本文中&#xff0c;我们将探讨在 redis-…

SpringBoot整合DataWay配置前端查询

Dataway介绍 Dataway 是基于 DataQL 服务聚合能力&#xff0c;为应用提供的一个接口配置工具。使得使用者无需开发任何代码就配置一个满足需求的接口。整个接口配置、测试、冒烟、发布。一站式都通过 Dataway 提供的 UI 界面完成。UI 会以 Jar 包方式提供并集成到应用中并和应…

Springboot学习笔记——3

Springboot学习笔记——3 一、热部署1.1、手动启动热部署1.2、自动启动热部署1.3、热部署范围配置1.4、关闭热部署 二、配置高级2.1、第三方bean属性绑定2.2、松散绑定2.3、常用计量单位应用2.4、bean属性校验2.5、进制数据转换规则 三、测试3.1、加载测试专用属性3.2、加载测试…

mysql面试题32:MySQL数据库服务器性能分析的方法命令有哪些?

该文章专注于面试,面试只要回答关键点即可,不需要对框架有非常深入的回答,如果你想应付面试,是足够了,抓住关键点 面试官:MySQL数据库服务器性能分析的方法命令有哪些? MySQL数据库服务器性能分析的方法和命令有以下几种: EXPLAIN命令:用于分析查询语句的执行计划,…

基于springboot实现在线动漫信息交流分享平台项目【项目源码+论文说明】计算机毕业设计

基于springboot实现在线动漫信息交流分享平台演示 摘要 随着社会互联网技术的快速发展&#xff0c;每个行业都在努力与现代先进技术接轨&#xff0c;通过科技手段提高自身的优势&#xff1b;对于在线动漫信息平台当然也不能排除在外&#xff0c;随着网络技术的不断成熟&#x…

结婚请帖邀请函制作全攻略,一分钟学会

结婚是人生的重要时刻之一&#xff0c;而一份精美的结婚请帖邀请函则是新人向亲友们发出完美邀请的必备品。为了让你轻松制作出令人惊艳的结婚请帖邀请函&#xff0c;我们为你推荐一个简单易用的在线制作平台——乔拓云微传单平台。只需一分钟&#xff0c;你就能轻松学会&#…

城市项目招商创业园区供需特产公益小程序开源版开发

城市项目招商创业园区供需特产公益小程序开源版开发 城市项目招商创业园区供需特产公益小程序的功能主要包括以下几个方面&#xff1a; 项目招商&#xff1a;提供城市项目招商信息&#xff0c;包括项目介绍、投资额、回报率等详细信息&#xff0c;方便投资者了解项目情况&#…

云数据库(林子雨慕课课程)

文章目录 6.云数据库6.1 云数据库概述6.2 云数据库产品6.3 UMP系统6.3.1 UMP系统概述6.3.2 UMP系统架构6.3.3 UMP系统功能 6.4 Amazon云数据库6.4.1 Amazon和云计算的渊源6.4.2 Amazon AWS6.4.3 AWS平台上的云数据库6.5 微软云数据库SQL Azure 6.云数据库 6.1 云数据库概述 云…

小说推文和短剧推广真的赚钱吗以及授权渠道

先说授权渠道&#xff0c;可以通过”巨量推文“进行申请授权 小说推文和短剧推广大致分为cpa拉新 cps分成和cpm广告点击的收益 cpa拉新是通过你的引导进入后的新用户 cps分成是根据你的引导进入后并付费一定的比例分成给你 cpm广告点击是进入小程序后看了广告和点击了广告的…

浅述安防视频可视化场景中TSINGSEE青犀AI智能化应用的分析

随着社会的不断发展和安防需求的不断提升&#xff0c;安防视频可视化场景已经成为人们关注的焦点。而随着人工智能、大数据等技术的不断发展&#xff0c;智能化应用在安防视频可视化场景中的应用也越来越多。本文将分析安防视频可视化场景中的智能化应用&#xff0c;主要包括以…

【QT】Windows 编译并使用 QT 5.12.7源码

1、下载 QT 源码 QT5.12.7源码下载地址: download | QT 5.12.7 选择任意一种下载即可&#xff0c;适用于 Windows 和 Linux 环境 ​ 这里选择下载 .zip 文件。 2、安装依赖 (1) 安装 perl perl 安装包下载地址: download | perl for windows 根据当前系统选择对应版本。…

[硬件基础]-555定时器-单稳态多谐振荡器配置

555定时器-单稳态多谐振荡器配置 文章目录 555定时器-单稳态多谐振荡器配置1、概述2、单稳态多谐振荡器的内部运行原理2.1 初始条件2.2 运行条件 在上一篇文章中&#xff0c;我们了解了555定时器的内部工作原理。 在本文中&#xff0c;我们将研究 555 定时器的单稳态操作模式。…

STC89C51基础及项目第14天:循迹小车、跟随小车

1. 循迹小车基本原理和方案&#xff08;269.114&#xff09; 循迹模块使用 TCRT5000传感器的红外发射二极管不断发射红外线&#xff1a;当发射出的红外线 没有 被反射回来或被反射回来但强度不够大时&#xff0c;红外接收管一直处于关断状态&#xff0c;此时模块的输出端为 高…

积分球测量作用

积分球在测量光通量上的使用可以追溯到1890年&#xff0c;并且现在已经成为一个多方面广泛使用的仪器。积分球是专门用于LED光色参数测量和光谱分析的仪器。LED光源以其体积小、能耗低、响应快、寿命长等诸多优点&#xff0c;在各个领域都得到广泛使用&#xff0e;积分球作为一…

腾讯云学生用户专享活动汇总

腾讯云一直致力于为广大用户提供更加优惠的云计算服务&#xff0c;其中也包括学生用户。为了让学生用户更好地享受腾讯云的优惠政策&#xff0c;腾讯云推出了多种学生用户专享的优惠活动。本文将为大家介绍腾讯云学生用户专享的优惠活动&#xff0c;帮助学生用户更好地了解腾讯…

修炼k8s+flink+hdfs+dlink(四:k8s(二)组件)

一&#xff1a;控制平面组件。 控制平面组件会为集群做出全局决策&#xff0c;比如资源的调度。 以及检测和响应集群事件&#xff0c;例如当不满足部署的 replicas 字段时&#xff0c; 要启动新的 pod&#xff09;。 1. kube-apiserver。 该组件负责公开了 Kubernetes API&a…

QECon大会亮相产品,全栈测试平台推荐:RunnerGo

最近在gitee上看见一款获得GVP&#xff08;最有价值开源项目&#xff09;的测试平台RunnerGo&#xff0c;看他们官网介绍包含了接口测试、性能测试、自动化测试。知道他们有saas版可以试用&#xff0c;果断使用了一下&#xff0c;对其中场景管理和性能测试印象深刻&#xff0c;…