Ollama +Mixtral + ChatBox 搭建本地团队使用的大语言模型

关于Ollama和Mixtral-8*7B以及ChatBox

  1. Ollama是一个 开源的本地大语言模型运行平台,通过类似Docker的CLI界面可以快速的在本地进行大语言模型的推理部署。
  2. Mixtra-87B模型是法国明星初创团队 Mistral 最新推出的首个开源混合专家 MoE 模型。我在Git上找到了ymcui大神基于Mixtra-87B 0.1版本精调的中文混合专家模型。中文Mixtral混合专家模型
  3. ChatBox是个接入多个主流大语言模型的APP,1.30版本对Ollama本地服务的适配很不错,推荐。Chatbox下载链接

环境准备

我们的部署环境如下:

  1. 硬件环境
    1. AMD 5950X
    2. 128GB RAM
    3. RTX 3090(24G VRAM)
  2. 操作系统
    1. Win 10 19045.4170

Ollama安装

  1. Ollama Windows Preview页面 下载Ollama服务端应用:Ollama Windows Preview
  2. 安装后,操作系统会自动启动ollama服务,并在11434端口监听。
  3. 在命令行或者PowerShell中测试以下命令,ollama会自动下载llama2中文版本的4-bit 量化模型文件,需要至少 8GB 的内存进行推理。
ollama pull llama2-chinese

使用pull命令下载llama2-chinese模型文件然后使用run命令运行llama2-chinese模型:

ollama run llama2-chinese '如何使用httpd配置反向代理?'

ollama会很快推理并反馈如下结果:
在这里插入图片描述这说明Ollama服务已经成功部署在我们的本地服务器上了🥳

ChatBox安装

ChatBox是标准的Windows Installer安装,可以轻松搞定。

下载Mixtral-Chinese的量化模型文件:

Mixtral-Chinese的量化模型下载地址
作者很贴心,批量把各不同精度的量化文件都上传到HuggingFace了,我们选用ggml-model-q4_k.gguf这个模型文件,然后慢慢下载了。

  • 21
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
好的,这是一个简单的在线客服对话框的 HTML、CSS、JS 代码示例: ``` <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>在线客服对话框</title> <style> body { margin: 0; padding: 0; font-family: Arial, sans-serif; } .chatbox { position: fixed; bottom: 20px; right: 20px; width: 300px; border: 1px solid #ccc; border-radius: 5px; background-color: #fff; box-shadow: 0px 0px 5px #ccc; z-index: 9999; } .chatbox-header { padding: 10px; border-bottom: 1px solid #ccc; background-color: #f0f0f0; border-radius: 5px 5px 0 0; } .chatbox-header h2 { margin: 0; font-size: 16px; font-weight: bold; color: #333; } .chatbox-body { padding: 10px; min-height: 200px; max-height: 400px; overflow-y: scroll; scroll-behavior: smooth; word-wrap: break-word; color: #555; font-size: 14px; } .chatbox-body p { margin: 0 0 10px 0; padding: 5px 10px; border-radius: 10px; background-color: #f0f0f0; max-width: 70%; } .chatbox-footer { padding: 10px; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; border-top: 1px solid #ccc; border-radius: 0 0 5px 5px; } .chatbox-footer input[type=text] { flex: 1; padding: 10px; border: none; border-radius: 5px; box-shadow: 0px 0px 5px #ccc; margin-right: 10px; font-size: 14px; } .chatbox-footer input[type=submit] { padding: 10px 20px; border: none; border-radius: 5px; background-color: #005ea5; color: #fff; font-size: 14px; cursor: pointer; transition: background-color 0.3s ease-in-out; } .chatbox-footer input[type=submit]:hover { background-color: #003e70; } </style> </head> <body> <div class="chatbox"> <div class="chatbox-header"> <h2>在线客服</h2> </div> <div class="chatbox-body"> <p>欢迎来到在线客服对话框!</p> </div> <div class="chatbox-footer"> <input type="text" placeholder="请输入您的问题..."> <input type="submit" value="发送"> </div> </div> <script> // 获取 DOM 元素 const chatbox = document.querySelector('.chatbox'); const input = chatbox.querySelector('input[type=text]'); const submitBtn = chatbox.querySelector('input[type=submit]'); const chatboxBody = chatbox.querySelector('.chatbox-body'); // 提交问题 function submitQuestion() { const question = input.value.trim(); if (question !== '') { // 发送问题 const questionP = document.createElement('p'); questionP.textContent = question; questionP.style.textAlign = 'right'; chatboxBody.appendChild(questionP); // 清空输入框 input.value = ''; // 模拟机器人回答 setTimeout(function() { // 机器人回答 const answer = '非常抱歉,目前无法回答您的问题。'; const answerP = document.createElement('p'); answerP.textContent = answer; chatboxBody.appendChild(answerP); }, 1000); } }; // 绑定按钮事件 submitBtn.addEventListener('click', submitQuestion); // 回车也可以提交问题 input.addEventListener('keydown', function(e) { if (e.key === 'Enter') { submitQuestion(); } }); </script> </body> </html> ``` 以上代码实现了一个简单的在线客服对话框,用户可以通过文本框输入问题,机器人会自动回复一些文本。你可以根据自己的需要修改样式和代码逻辑。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值