Open main menu
首页
专栏
课程
分类
归档
Chat
Sci-Hub
谷歌学术
Libgen
GitHub镜像
登录/注册
搜索
搜索
关闭
Previous
Previous
Next
Next
这个ChatGPT项目有了重大更新,可以直接打包成桌面应用
sockstack
/
111
/
2023-11-14 11:45:45
<p><span style="color: red; font-size: 18px">ChatGPT 可用网址,仅供交流学习使用,如对您有所帮助,请收藏并推荐给需要的朋友。</span><br><a href="https://ckai.xyz/?sockstack§ion=detail" target="__blank">https://ckai.xyz</a><br><br></p> <article class="_2rhmJa"><blockquote> <p>在之前的文章中介绍过一个国内大神开放的<code>ChatGPT</code>项目,最近这个仓库有了重大的更新,可以把<code>web</code>的应用打包成桌面的应用。外观上也作出了改变,把界面做的更加简洁。<br> </p> <div class="image-package"> <div class="image-container" style="max-width: 700px; max-height: 321px; background-color: transparent;"> <div class="image-container-fill" style="padding-bottom: 45.800000000000004%;"></div> <div class="image-view" data-width="2334" data-height="1069"><img referrerpolicy="no-referrer" data-original-src="//upload-images.jianshu.io/upload_images/10874422-3e0d2fd0dc4213b5.png" data-original-width="2334" data-original-height="1069" data-original-format="image/jpeg" data-original-filesize="208587" data-image-index="0" style="cursor: zoom-in;" class="" src="//upload-images.jianshu.io/upload_images/10874422-3e0d2fd0dc4213b5.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1200/format/webp"></div> </div> <div class="image-caption"></div> </div> <br> 通过查看源码,是采用<code>electron</code>进行桌面应用的构建,目前,国内也不能直接调用<code>OpenAI</code>的接口,需要魔法上网才可以,所以,构建了桌面应用后,我们需要进行魔法上网才可以正常使用。<p></p> </blockquote> <p>好了,废话不多说,下面简单介绍一下部署方法</p> <h2>采用docker方式进行部署</h2> <h3>检查docker环境</h3> <p>采用docker方式部署,前提是服务器的环境已经正确的安全了<code>docker</code>环境,执行如下命令检查是否正确安装</p> <div class="_2Uzcx_"> <button class="VJbwyy" type="button" aria-label="复制代码"><i aria-label="icon: copy" class="anticon anticon-copy"><svg viewbox="64 64 896 896" focusable="false" class="" data-icon="copy" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M832 64H296c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h496v688c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V96c0-17.7-14.3-32-32-32zM704 192H192c-17.7 0-32 14.3-32 32v530.7c0 8.5 3.4 16.6 9.4 22.6l173.3 173.3c2.2 2.2 4.7 4 7.4 5.5v1.9h4.2c3.5 1.3 7.2 2 11 2H704c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32zM350 856.2L263.9 770H350v86.2zM664 888H414V746c0-22.1-17.9-40-40-40H232V264h432v624z"></path></svg></i></button><pre class="line-numbers language-shell"><code class="shell language-shell">docker version <span aria-hidden="true" class="line-numbers-rows"><span></span></span></code></pre> </div> <div class="image-package"> <div class="image-container" style="max-width: 700px; max-height: 445px; background-color: transparent;"> <div class="image-container-fill" style="padding-bottom: 51.739999999999995%;"></div> <div class="image-view" data-width="860" data-height="445"><img referrerpolicy="no-referrer" data-original-src="//upload-images.jianshu.io/upload_images/10874422-7289d06331327e6d.png" data-original-width="860" data-original-height="445" data-original-format="image/png" data-original-filesize="31028" data-image-index="1" style="cursor: zoom-in;" class="" src="//upload-images.jianshu.io/upload_images/10874422-7289d06331327e6d.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/860/format/webp"></div> </div> <div class="image-caption"></div> </div> <h3>拉取项目</h3> <p>在服务器的<code>home</code>目录下,拉取项目,执行如下命令:</p> <div class="_2Uzcx_"> <button class="VJbwyy" type="button" aria-label="复制代码"><i aria-label="icon: copy" class="anticon anticon-copy"><svg viewbox="64 64 896 896" focusable="false" class="" data-icon="copy" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M832 64H296c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h496v688c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V96c0-17.7-14.3-32-32-32zM704 192H192c-17.7 0-32 14.3-32 32v530.7c0 8.5 3.4 16.6 9.4 22.6l173.3 173.3c2.2 2.2 4.7 4 7.4 5.5v1.9h4.2c3.5 1.3 7.2 2 11 2H704c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32zM350 856.2L263.9 770H350v86.2zM664 888H414V746c0-22.1-17.9-40-40-40H232V264h432v624z"></path></svg></i></button><pre class="line-numbers language-shell"><code class="shell language-shell">git clone git@github.com:202252197/ChatGPT_JCM.git <span aria-hidden="true" class="line-numbers-rows"><span></span></span></code></pre> </div> <div class="image-package"> <div class="image-container" style="max-width: 700px; max-height: 141px;"> <div class="image-container-fill" style="padding-bottom: 16.650000000000002%;"></div> <div class="image-view" data-width="847" data-height="141"><img referrerpolicy="no-referrer" data-original-src="//upload-images.jianshu.io/upload_images/10874422-101e1ee3d2f72acf.png" data-original-width="847" data-original-height="141" data-original-format="image/png" data-original-filesize="17330" data-image-index="2" style="cursor: zoom-in;" class="image-loading"></div> </div> <div class="image-caption"></div> </div> <h3>修改配置</h3> <p>进入项目的根目录,在<code>.env.serve</code>中添加代码<code>OPENAI_API_KEY</code></p> <div class="_2Uzcx_"> <button class="VJbwyy" type="button" aria-label="复制代码"><i aria-label="icon: copy" class="anticon anticon-copy"><svg viewbox="64 64 896 896" focusable="false" class="" data-icon="copy" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M832 64H296c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h496v688c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V96c0-17.7-14.3-32-32-32zM704 192H192c-17.7 0-32 14.3-32 32v530.7c0 8.5 3.4 16.6 9.4 22.6l173.3 173.3c2.2 2.2 4.7 4 7.4 5.5v1.9h4.2c3.5 1.3 7.2 2 11 2H704c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32zM350 856.2L263.9 770H350v86.2zM664 888H414V746c0-22.1-17.9-40-40-40H232V264h432v624z"></path></svg></i></button><pre class="line-numbers language-shell"><code class="shell language-shell">VUE_APP_OPENAI_API_KEY='你的openai api key' <span aria-hidden="true" class="line-numbers-rows"><span></span></span></code></pre> </div> <blockquote> <p>在<code>/src/store/mutation-types.js</code>可以在此文件中设置AI头像+用户头像+用户名称</p> </blockquote> <h3>构建镜像</h3> <p>使用以下命令构建镜像,其中<code>jcm-chatgpt</code>是您想要给镜像取的名称,"." 表示<code>Dockerfile</code>在当前目录中。</p> <div class="_2Uzcx_"> <button class="VJbwyy" type="button" aria-label="复制代码"><i aria-label="icon: copy" class="anticon anticon-copy"><svg viewbox="64 64 896 896" focusable="false" class="" data-icon="copy" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M832 64H296c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h496v688c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V96c0-17.7-14.3-32-32-32zM704 192H192c-17.7 0-32 14.3-32 32v530.7c0 8.5 3.4 16.6 9.4 22.6l173.3 173.3c2.2 2.2 4.7 4 7.4 5.5v1.9h4.2c3.5 1.3 7.2 2 11 2H704c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32zM350 856.2L263.9 770H350v86.2zM664 888H414V746c0-22.1-17.9-40-40-40H232V264h432v624z"></path></svg></i></button><pre class="line-numbers language-shell"><code class="shell language-shell">docker build -t jcm-chatgpt . <span aria-hidden="true" class="line-numbers-rows"><span></span></span></code></pre> </div> <div class="image-package"> <div class="image-container" style="max-width: 700px; max-height: 425px;"> <div class="image-container-fill" style="padding-bottom: 25.480000000000004%;"></div> <div class="image-view" data-width="1668" data-height="425"><img referrerpolicy="no-referrer" data-original-src="//upload-images.jianshu.io/upload_images/10874422-567c4e3889f7f685.png" data-original-width="1668" data-original-height="425" data-original-format="image/png" data-original-filesize="81727" data-image-index="3" style="cursor: zoom-in;" class="image-loading"></div> </div> <div class="image-caption"></div> </div> <h3>运行镜像</h3> <p>构建完成后,可以使用以下命令运行镜像,其中 "my-container" 是您想要给容器取的名称。该命令会将容器端口<code>9090</code>映射到本地机器的端口<code>80</code>。</p> <div class="_2Uzcx_"> <button class="VJbwyy" type="button" aria-label="复制代码"><i aria-label="icon: copy" class="anticon anticon-copy"><svg viewbox="64 64 896 896" focusable="false" class="" data-icon="copy" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M832 64H296c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h496v688c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V96c0-17.7-14.3-32-32-32zM704 192H192c-17.7 0-32 14.3-32 32v530.7c0 8.5 3.4 16.6 9.4 22.6l173.3 173.3c2.2 2.2 4.7 4 7.4 5.5v1.9h4.2c3.5 1.3 7.2 2 11 2H704c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32zM350 856.2L263.9 770H350v86.2zM664 888H414V746c0-22.1-17.9-40-40-40H232V264h432v624z"></path></svg></i></button><pre class="line-numbers language-shell"><code class="shell language-shell">docker run --name my-chatgpt -p 9090:80 jcm-chatgpt <span aria-hidden="true" class="line-numbers-rows"><span></span></span></code></pre> </div> <h3>会话</h3> <div class="image-package"> <div class="image-container" style="max-width: 700px; max-height: 323px;"> <div class="image-container-fill" style="padding-bottom: 46.06%;"></div> <div class="image-view" data-width="2334" data-height="1075"><img referrerpolicy="no-referrer" data-original-src="//upload-images.jianshu.io/upload_images/10874422-e034c9adb7e8e078.png" data-original-width="2334" data-original-height="1075" data-original-format="image/jpeg" data-original-filesize="186642" data-image-index="4" style="cursor: zoom-in;" class="image-loading"></div> </div> <div class="image-caption"></div> </div> <h3>模型</h3> <div class="image-package"> <div class="image-container" style="max-width: 700px; max-height: 322px;"> <div class="image-container-fill" style="padding-bottom: 45.89%;"></div> <div class="image-view" data-width="2334" data-height="1071"><img referrerpolicy="no-referrer" data-original-src="//upload-images.jianshu.io/upload_images/10874422-3a8f0650dbfa63f4.png" data-original-width="2334" data-original-height="1071" data-original-format="image/jpeg" data-original-filesize="257549" data-image-index="5" style="cursor: zoom-in;" class="image-loading"></div> </div> <div class="image-caption"></div> </div> <h3>微调模型列表</h3> <div class="image-package"> <div class="image-container" style="max-width: 700px; max-height: 323px;"> <div class="image-container-fill" style="padding-bottom: 46.1%;"></div> <div class="image-view" data-width="2334" data-height="1076"><img referrerpolicy="no-referrer" data-original-src="//upload-images.jianshu.io/upload_images/10874422-1bfe93aef0256903.png" data-original-width="2334" data-original-height="1076" data-original-format="image/jpeg" data-original-filesize="197041" data-image-index="6" style="cursor: zoom-in;" class="image-loading"></div> </div> <div class="image-caption"></div> </div> <h3>文件</h3> <div class="image-package"> <div class="image-container" style="max-width: 700px; max-height: 321px;"> <div class="image-container-fill" style="padding-bottom: 45.800000000000004%;"></div> <div class="image-view" data-width="2334" data-height="1069"><img referrerpolicy="no-referrer" data-original-src="//upload-images.jianshu.io/upload_images/10874422-5afc0fd442757057.png" data-original-width="2334" data-original-height="1069" data-original-format="image/jpeg" data-original-filesize="208587" data-image-index="7" style="cursor: zoom-in;" class="image-loading"></div> </div> <div class="image-caption"></div> </div> <h2>总结</h2> <p>该项目已经在github上开源,并获得1.2k start。在部署过程中遇到什么问题欢迎留言讨论。<br> 项目地址是:<a href="https://links.jianshu.com/go?to=https%3A%2F%2Fgithub.com%2F202252197%2FChatGPT_JCM.git" target="_blank">https://github.com/202252197/ChatGPT_JCM.git</a>。 如果,想获取更多精彩的内容可以关注我的公众号。<br> </p> <p></p> <p>本文由<a href="https://links.jianshu.com/go?to=https%3A%2F%2Fmdnice.com%2F%3Fplatform%3D6" target="_blank">mdnice</a>多平台发布</p> </article>
这个ChatGPT项目有了重大更新,可以直接打包成桌面应用
作者
sockstack
许可协议
CC BY 4.0
发布于
2023-11-14
修改于
2024-09-02
上一篇:软件:常用 Linux 软件汇总,值得收藏
下一篇:chatGPT国内可用镜像源地址
尚未登录
登录 / 注册
文章分类
博客重构之路
5
Spring Boot简单入门
4
k8s 入门教程
0
MySQL 知识
1
NSQ 消息队列
0
ThinkPHP5 源码分析
5
使用 Docker 从零开始搭建私人代码仓库
3
日常开发汇总
3
标签列表
springboot
hyperf
swoole
webman
php
多线程
数据结构
docker
k8s
thinkphp
mysql
tailwindcss
flowbite
css
前端