电子商务网站的管理,企业网站建设的核心,东营黄河口宠物信息网,微信公众号怎么开发小程序文章目录 1. 安装 web UI1.1. 下载代码库1.2. 创建 conda 环境1.3. 安装 pytorch1.4. 安装 pip 库 2. 下载大模型3. 使用 web UI3.1. 运行 UI 界面3.2. 加载模型3.3. 进行对话 使用 web UI 大模型文件#xff0c;即可在笔记本上部署、使用类 gpt 大模型。
1. 安装 web UI
1… 文章目录 1. 安装 web UI1.1. 下载代码库1.2. 创建 conda 环境1.3. 安装 pytorch1.4. 安装 pip 库 2. 下载大模型3. 使用 web UI3.1. 运行 UI 界面3.2. 加载模型3.3. 进行对话 使用 web UI 大模型文件即可在笔记本上部署、使用类 gpt 大模型。
1. 安装 web UI
1.1. 下载代码库
https://github.com/oobabooga/text-generation-webui
1.2. 创建 conda 环境
conda create -n textgen python3.11
conda activate textgen1.3. 安装 pytorch
文档https://github.com/oobabooga/text-generation-webui#2-install-pytorch
SystemGPUCommandLinux/WSLNVIDIApip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121Linux/WSLCPU onlypip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpuLinuxAMDpip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/rocm5.6MacOS MPSAnypip3 install torch torchvision torchaudioWindowsNVIDIApip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121WindowsCPU onlypip3 install torch torchvision torchaudio
1.4. 安装 pip 库
文档https://github.com/oobabooga/text-generation-webui#3-install-the-web-ui
pip install -r requirements file according to table belowGPUCPUrequirements file to useNVIDIAhas AVX2requirements.txtNVIDIAno AVX2requirements_noavx2.txtAMDhas AVX2requirements_amd.txtAMDno AVX2requirements_amd_noavx2.txtCPU onlyhas AVX2requirements_cpu_only.txtCPU onlyno AVX2requirements_cpu_only_noavx2.txtAppleIntelrequirements_apple_intel.txtAppleApple Siliconrequirements_apple_silicon.txt
2. 下载大模型
TheBloke: https://huggingface.co/TheBloke
TheBloke 是 hugging face 社区的一个用户 ta 提供了许多预量化大模型的下载。
量化将模型权重中的 float 替换为 int 等数据类型损失一小部分精度但减少内存占用、计算开销。 在该用户的 model 库中搜索需要的模型常用关键词是 7b-gguf。
其中 7b 代表模型的参数量 7 billion常见参数量有 7b 13b 70b参数量越大模型精度越高即对话质量越高。gguf 是一个预量化大模型的格式支持 cpu 、 gpu 共同加载模型被广泛使用 在具体模型页面的 Provided files 部分可以看到该模型的不同量化版本、文件大小、预计内存占用、推荐与否。点击具体量化版本的模型即可下载。
3. 使用 web UI
3.1. 运行 UI 界面
打开 conda 命令行窗口运行以下命令并保持窗口开启
conda activate textgen
cd text-generation-webui
python server.py3.2. 加载模型 打开 127.0.0.1:7860 网页链接model 页面按上图进行模型加载即可大概需要几十秒。
具体文档https://github.com/oobabooga/text-generation-webui/wiki/04-‐-Model-Tab#llamacpp
3.3. 进行对话 打开 chat 页面即可进行对话。
在对话框左侧菜单中有 “开始新对话” 等操作需注意大部分模型默认语言为英文可在模型页面查看详情本地模型无法联网