国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

大模型部署手記(8)LLaMa2+Windows+llama.cpp+英文文本補齊

這篇具有很好參考價值的文章主要介紹了大模型部署手記(8)LLaMa2+Windows+llama.cpp+英文文本補齊。希望對大家有所幫助。如果存在錯誤或未考慮完全的地方,請大家不吝賜教,您也可以點擊"舉報違法"按鈕提交疑問。

llama2模型部署,大模型,深度學(xué)習(xí),windows

1.簡介:

組織機構(gòu):Meta(Facebook)

代碼倉:https://github.com/facebookresearch/llama

模型:llama-2-7b

下載:使用download.sh下載

硬件環(huán)境:暗影精靈7Plus

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

內(nèi)存 32G

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

llama2模型部署,大模型,深度學(xué)習(xí),windows

2.代碼和模型下載:

下載llama.cpp的代碼倉:

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

llama2模型部署,大模型,深度學(xué)習(xí),windows

需要獲取原始LLaMA的模型文件,放到 models目錄下,現(xiàn)在models目錄下是這樣的:

llama2模型部署,大模型,深度學(xué)習(xí),windows

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

將上次在Jetson AGX Orin上的成功運行的7B模型文件傳到 models目錄下:

llama2模型部署,大模型,深度學(xué)習(xí),windows

3.llama.cpp環(huán)境安裝:

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

llama2模型部署,大模型,深度學(xué)習(xí),windows

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

llama2模型部署,大模型,深度學(xué)習(xí),windows

找到最新fortran版本的 w64devkit:

llama2模型部署,大模型,深度學(xué)習(xí),windows

下載完成后系統(tǒng)彈出:

llama2模型部署,大模型,深度學(xué)習(xí),windows

往前找一個版本v.19.0試試:https://github.com/skeeto/w64devkit/releases/tag/v1.19.0llama2模型部署,大模型,深度學(xué)習(xí),windows

解壓到 D:\w64devkit

llama2模型部署,大模型,深度學(xué)習(xí),windows

運行 w64devkit.exe

llama2模型部署,大模型,深度學(xué)習(xí),windows

切換到 d: 盤

cd llama.cpp

llama2模型部署,大模型,深度學(xué)習(xí),windows

python -V

llama2模型部署,大模型,深度學(xué)習(xí),windows

這里python是3.7.5版本。

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

llama2模型部署,大模型,深度學(xué)習(xí),windows

編譯試試:

make

llama2模型部署,大模型,深度學(xué)習(xí),windows

耐心等待編譯結(jié)束(或者編譯出錯)

llama2模型部署,大模型,深度學(xué)習(xí),windows

llama2模型部署,大模型,深度學(xué)習(xí),windows

這個到底算不算惡意軟件呢?

llama2模型部署,大模型,深度學(xué)習(xí),windows

張小白感覺不像,于是到llama.cpp的官方去提了個issue確認一下:https://github.com/ggerganov/llama.cpp/issues/3463

llama2模型部署,大模型,深度學(xué)習(xí),windows

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

llama2模型部署,大模型,深度學(xué)習(xí),windows

張小白還是決定使用 w64devkit,而且是最新版。在編譯期間關(guān)掉 360殺毒軟件?。。。ㄆ鋵嵾€得關(guān)閉360安全衛(wèi)士)

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

下載 w64devkit-fortran-1.20.0.zip

解壓到D盤:

llama2模型部署,大模型,深度學(xué)習(xí),windows

雙擊運行 w64devkit.exe

llama2模型部署,大模型,深度學(xué)習(xí),windows

cd d:/

cd llama.cpp

make

llama2模型部署,大模型,深度學(xué)習(xí),windows

llama2模型部署,大模型,深度學(xué)習(xí),windows

耐心等待編譯結(jié)束:

llama2模型部署,大模型,深度學(xué)習(xí),windows

編譯成功。

llama2模型部署,大模型,深度學(xué)習(xí),windows

其中exe就是生成好的windows可執(zhí)行文件。

退出 w64devkit.編譯環(huán)境。

4.安裝依賴

創(chuàng)建conda環(huán)境

conda create -n llama python=3.10

conda activate llama

llama2模型部署,大模型,深度學(xué)習(xí),windows

cd llama.cpp

pip install -r requirements.txt

llama2模型部署,大模型,深度學(xué)習(xí),windows

5.部署驗證

閱讀下面這段內(nèi)容:

llama2模型部署,大模型,深度學(xué)習(xí),windows

將7B模型(14G左右)轉(zhuǎn)換成 ggml FP16模型

python convert.py models/7B/

llama2模型部署,大模型,深度學(xué)習(xí),windows

llama2模型部署,大模型,深度學(xué)習(xí),windows

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

llama2模型部署,大模型,深度學(xué)習(xí),windows

將剛才轉(zhuǎn)換好的FP16模型進行4-bit量化:

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

llama2模型部署,大模型,深度學(xué)習(xí),windows

llama2模型部署,大模型,深度學(xué)習(xí),windows

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

llama2模型部署,大模型,深度學(xué)習(xí),windows

大小只有3.8G了。

進行推理:

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

llama2模型部署,大模型,深度學(xué)習(xí),windows

llama2模型部署,大模型,深度學(xué)習(xí),windows

運行結(jié)果如下:

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"

llama2模型部署,大模型,深度學(xué)習(xí),windows

llama2模型部署,大模型,深度學(xué)習(xí),windows

llama2模型部署,大模型,深度學(xué)習(xí),windows

補齊的文字如下:

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原始模型都是英文回答(后面會考慮試驗改進后的中文),有請詞霸翻譯一下:

llama2模型部署,大模型,深度學(xué)習(xí),windows

llama2模型部署,大模型,深度學(xué)習(xí),windows

llama2模型部署,大模型,深度學(xué)習(xí),windows

llama2模型部署,大模型,深度學(xué)習(xí),windows

llama2模型部署,大模型,深度學(xué)習(xí),windows

先試驗到這里吧!文章來源地址http://www.zghlxwxcb.cn/news/detail-773860.html

到了這里,關(guān)于大模型部署手記(8)LLaMa2+Windows+llama.cpp+英文文本補齊的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來自互聯(lián)網(wǎng)用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務(wù),不擁有所有權(quán),不承擔(dān)相關(guān)法律責(zé)任。如若轉(zhuǎn)載,請注明出處: 如若內(nèi)容造成侵權(quán)/違法違規(guī)/事實不符,請點擊違法舉報進行投訴反饋,一經(jīng)查實,立即刪除!

領(lǐng)支付寶紅包贊助服務(wù)器費用

相關(guān)文章

  • 大模型部署手記(13)LLaMa2+Chinese-LLaMA-Plus-2-7B+Windows+LangChain+摘要問答

    大模型部署手記(13)LLaMa2+Chinese-LLaMA-Plus-2-7B+Windows+LangChain+摘要問答

    組織機構(gòu):Meta(Facebook) 代碼倉:GitHub - facebookresearch/llama: Inference code for LLaMA models 模型:chinese-alpaca-2-7b-hf、text2vec-large-chinese 下載:使用百度網(wǎng)盤和huggingface.co下載 硬件環(huán)境:暗影精靈7Plus Windows版本:Windows 11家庭中文版 Insider Preview 22H2 內(nèi)存 32G GPU顯卡:Nvidia GTX 3080 Laptop

    2024年02月04日
    瀏覽(20)
  • llama.cpp LLM模型 windows cpu安裝部署;運行LLaMA2模型測試

    llama.cpp LLM模型 windows cpu安裝部署;運行LLaMA2模型測試

    參考: https://www.listera.top/ji-xu-zhe-teng-xia-chinese-llama-alpaca/ https://blog.csdn.net/qq_38238956/article/details/130113599 cmake windows安裝參考:https://blog.csdn.net/weixin_42357472/article/details/131314105 1、下載: 2、編譯 3、測試運行 參考: https://zhuanlan.zhihu.com/p/638427280 模型下載: https://huggingface.co/nya

    2024年02月16日
    瀏覽(29)
  • llama.cpp LLM模型 windows cpu安裝部署;運行LLaMA-7B模型測試

    llama.cpp LLM模型 windows cpu安裝部署;運行LLaMA-7B模型測試

    參考: https://www.listera.top/ji-xu-zhe-teng-xia-chinese-llama-alpaca/ https://blog.csdn.net/qq_38238956/article/details/130113599 cmake windows安裝參考:https://blog.csdn.net/weixin_42357472/article/details/131314105 1、下載: 2、編譯 3、測試運行 參考: https://zhuanlan.zhihu.com/p/638427280 模型下載: https://huggingface.co/nya

    2024年02月15日
    瀏覽(17)
  • Windows11下私有化部署大語言模型實戰(zhàn) langchain+llama2

    Windows11下私有化部署大語言模型實戰(zhàn) langchain+llama2

    CPU:銳龍5600X 顯卡:GTX3070 內(nèi)存:32G 注:硬件配置僅為博主的配置,不是最低要求配置,也不是推薦配置。該配置下計算速度約為40tokens/s。實測核顯筆記本(i7-1165g7)也能跑,速度3tokens/s。 Windows系統(tǒng)版本:Win11專業(yè)版23H2 Python版本:3.11 Cuda版本:12.3.2 VS版本:VS2022 17.8.3 lan

    2024年02月03日
    瀏覽(1177)
  • llama.cpp LLM模型 windows cpu安裝部署

    llama.cpp LLM模型 windows cpu安裝部署

    參考: https://www.listera.top/ji-xu-zhe-teng-xia-chinese-llama-alpaca/ https://blog.csdn.net/qq_38238956/article/details/130113599 cmake windows安裝參考:https://blog.csdn.net/weixin_42357472/article/details/131314105 1、下載: 2、編譯 3、測試運行 參考: https://zhuanlan.zhihu.com/p/638427280 模型下載: https://huggingface.co/nya

    2024年02月11日
    瀏覽(21)
  • AI-windows下使用llama.cpp部署本地Chinese-LLaMA-Alpaca-2模型

    生成的文件在 .buildbin ,我們要用的是 main.exe , binmain.exe -h 查看使用幫助 本項目基于Meta發(fā)布的可商用大模型Llama-2開發(fā),是中文LLaMAAlpaca大模型的第二期項目,開源了中文LLaMA-2基座模型和Alpaca-2指令精調(diào)大模型。這些模型在原版Llama-2的基礎(chǔ)上擴充并優(yōu)化了中文詞表,使用

    2024年04月25日
    瀏覽(33)
  • llama.cpp LLM模型 windows cpu安裝部署踩坑記錄

    llama.cpp LLM模型 windows cpu安裝部署踩坑記錄

    一直想在自己的筆記本上部署一個大模型驗證,早就聽說了llama.cpp,可是一直沒時間弄。 今天終于有時間驗證了。首先本機安裝好g++,cmake.我下載的cmake版本是cmake-3.27.0-rc4-windows-x86_64.msi。安裝時選擇增加系統(tǒng)變量。接著GitHub - ggerganov/llama.cpp: Port of Facebook\\\'s LLaMA model in C/C++ 執(zhí)行

    2024年02月15日
    瀏覽(26)
  • 大模型Llama2部署,基于text-generation-webui、Llama2-Chinese

    參考安裝教程:傻瓜式!一鍵部署llama2+chatglm2,集成所有環(huán)境和微調(diào)功能,本地化界面操作! Github地址:GitHub - oobabooga/text-generation-webui: A Gradio web UI for Large Language Models. Supports transformers, GPTQ, llama.cpp (ggml/gguf), Llama models. 模型下載地址:meta-llama/Llama-2-13b-chat-hf at main 遇到的問

    2024年02月08日
    瀏覽(24)
  • llama.cpp部署在windows

    llama.cpp部署在windows

    本想部署LLAMA模型,但是基于顯卡和多卡的要求,很難部署在個人筆記本上,因此搜索發(fā)現(xiàn)有一個量化版本的LLAMA.cpp,部署過程和踩過的坑如下: (1)在GitHub - ggerganov/llama.cpp: Port of Facebook\\\'s LLaMA model in C/C++中下載cpp到本地 (2)創(chuàng)建conda環(huán)境 (3)安裝Cmake 在安裝 之前 我們需

    2024年02月04日
    瀏覽(20)
  • LLMs之LLaMA2:基于云端進行一鍵部署對LLaMA2模型實現(xiàn)推理(基于text-generation-webui)執(zhí)行對話聊天問答任務(wù)、同時微調(diào)LLaMA2模型(配置云端環(huán)境【A100】→下載數(shù)

    LLMs之LLaMA-2:基于云端進行一鍵部署對LLaMA2模型實現(xiàn)推理(基于text-generation-webui)執(zhí)行對話聊天問答任務(wù)、同時微調(diào)LLaMA2模型(配置云端環(huán)境【A100】→下載數(shù)據(jù)集【datasets】→加載模型【transformers】→分詞→模型訓(xùn)練【peft+SFTTrainer+wandb】→基于HuggingFace實現(xiàn)云端分享)之圖文教程詳

    2024年02月11日
    瀏覽(23)

覺得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請作者喝杯咖啡吧~博客贊助

支付寶掃一掃領(lǐng)取紅包,優(yōu)惠每天領(lǐng)

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包