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

大模型部署手记(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+中文对话icon-default.png?t=N7T8https://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对话:

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

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

相关文章:

  • C#导出本机Win32native dll
  • express-generator快速构建node后端项目
  • 视频监控系统/视频汇聚平台EasyCVR如何反向代理进行后端保活?
  • 金融信创黄金三年:小程序生态+跨端技术框架构建
  • 这短短 6 行代码你能数出几个bug?
  • 【毕设选题】深度学习 机器视觉 车位识别车道线检测 - python opencv
  • 不同数据类型在单片机内存中占多少字节?
  • 安卓LinearLayout让控件居中的办法
  • uniapp下拉刷新
  • 【工作记录】css3 grid布局笔记
  • 区块链技术-比特币数据结构
  • SpringBoot结合dev-tool 实现IDEA项目热部署
  • flink中使用外部定时器实现定时刷新
  • Spring Cloud Pipelines 入门实践
  • G1 GC详解及设置
  • GitHub详细教程
  • 【小沐学Python】Python实现Web图表功能(Dash)
  • 【RabbitMQ】docker rabbitmq集群 docker搭建rabbitmq集群
  • Linux 网络驱动实验
  • 访问Apache Tomcat的虚拟主机管理页面
  • 【算法】排序——归并排序和计数排序
  • discuz封面设置失败的解决办法(centos系统+windows系统)
  • AI绘画-Stable Diffusion笔记
  • 中值滤波算法及例程
  • SpringBoot 如何使用 Ehcache 作为缓存
  • Stable Diffusion 图片换脸插件Roop保姆教程 附错误解决办法和API使用
  • 华为OD机试 - 组成最大数(Java 2023 B卷 100分)
  • 十一、2023.10.5.计算机网络(end).11
  • 基于SpringBoot的网上摄影工作室
  • Spring源码解析——IOC之bean 的初始化