大模型部署手记(12)LLaMa2+Chinese-LLaMA-Plus-2-7B+Windows+text-gen+中文对话

大模型部署手记(12)LLaMa2+Chinese-LLaMA-Plus-2-7B+Windows+text-gen+中文对话

    正在检查是否收录...
一言准备中...

1.简介:

组织机构:Meta(Facebook)

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

模型:chinese-alpaca-2-7b-hf

下载:使用百度网盘下载

硬件环境:暗影精灵7Plus

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

内存 32G

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

从 https://github.com/ymcui/Chinese-LLaMA-Alpaca-2​

的README.md可以看出,中文LLaMA&Alpaca大模型支持不同的LLaMA生态:

这里面有

transformers

llama.cpp

text-generation-webui:

LangChain

privateGPT

vLLM

等多种。

在这里也介绍了不同环境上的部署方式:

2.代码和模型下载:

d:

cd \

git clone https://github.com/oobabooga/text-generation-webui

在 https://blog.csdn.net/snmper/article/details/133744735大模型部署手记(11)LLaMa2+Chinese-LLaMA-Plus-2-7B+Windows+llama.cpp+中文对话https://blog.csdn.net/snmper/article/details/133744735下载的完整版权重目录 D:\llama.cpp\models2\chinese-alpaca-2-7b-hf 复制到 D:\text-generation-webui\models 目录下:

3.安装依赖

参考 https://github.com/ymcui/Chinese-LLaMA-Alpaca-2/wiki/text-generation-webui_zh

和 https://github.com/oobabooga/text-generation-webui#installation

创建conda环境

conda create -n textgen python=3.10.9

conda activate textgen

cd text-generation-webui

安装pytorch

pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu117

安装依赖:

pip install -r requirements.txt

4.部署验证

加载模型并启动:

python server.py --model chinese-alpaca-2-7b-hf --chat

打开地址:

可以参考下面的指引操作:

在打开的网页中,依次选择Chat setting->Instruction template,在Instruction template中下拉选择Llama-v2,并将Context输入框中的Answer the questions.提示语替换为You are a helpful assistant. 你是一个乐于助人的助手。,最后回到Text generation界面,在input输入框中输入你的指令,即可与chinese-alpaca-2对话了。

不过张小白点击Model,发现这个模型已经加载上去了!

回到Chat屏幕,可以跟AI对话:

这个部署起来还是非常快的。

llamaalpacagitwebwebuigithubwindowschatfacebookivaurlpytorchpython大模型gpuclonellama2create百度网盘assistantlangchaintransformersgptllmtransformerideokr模型部署ai对话
  • 本文作者:WAP站长网
  • 本文链接: https://wapzz.net/post-2133.html
  • 版权声明:本博客所有文章除特别声明外,均默认采用 CC BY-NC-SA 4.0 许可协议。
本站部分内容来源于网络转载,仅供学习交流使用。如涉及版权问题,请及时联系我们,我们将第一时间处理。
文章很赞!支持一下吧 还没有人为TA充电
为TA充电
还没有人为TA充电
0
  • 支付宝打赏
    支付宝扫一扫
  • 微信打赏
    微信扫一扫
感谢支持
文章很赞!支持一下吧
关于作者
2.7W+
9
1
2
WAP站长官方

ChatGPT新漏洞:失控背出个人隐私泄露训练数据,OpenAI修复后依然有效

上一篇

昆仑万维发布「天工 SkyAgents」AI Agent 开发平台

下一篇
  • 复制图片
按住ctrl可打开默认菜单