开源了,免费使用GPT4(Windows/Linux/Mac 一键启动脚本)

开源了,免费使用GPT4(Windows一键启动脚本)

大家好,我打算每日花1小时来写一篇文章,这一小时包括文章主题思考和实现,连续日更几天,看看能不能被官方推荐。(帮我点点赞哦~)

今天的主题是:给之前写的文章开源了,免费使用GPT4,添加一个Windows/Linux/Mac 一键启动脚本,这篇文章如果对你帮助极大,欢迎你分享给你的朋友、她、他,一起成长。

也欢迎大家留言,说说自己想看什么主题的Python文章,留言越具体,我写的越快,比如留言:我想看Python 自动操作Excel 相关文章。

如果你有具体的需求想通过使用Python实现自动化,那将更好,欢迎私聊我微信,一起交流探讨。

今天给大家分享《黑客&网络安全入门&进阶学习资源包&GPT4》,朋友们如果有需要,可以保存下方卡片后,V扫描免肺领取哦~

Windows 一键启动脚本

我看 开源了,免费使用GPT4 文章有很多朋友留言说想要对应启动脚本的 Windows 版本,所以这篇文章给大家这个脚本,顺便介绍下如何写Windows脚本。

我已经fork项目,并添加了我写的几个脚本(已测试过运行ok)。

注意:启动脚本中的 G4F_PROXY 环境变量值 http://127.0.0.1:7890/ 需要大家替换成自己的网络地址,没有这个访问不了的,不用多说了哈🤣

大家可以输入以下指令git clone 我修改过的项目。

复制代码
git clone https://mirror.ghproxy.com/https://github.com/XksA-me/gpt4free

我在源项目 etc 下新建了一个 script 文件夹存放了本文提到的四个一键启动脚本。

Windows 脚本分为2个,第一个 win_install_env.bat,内容如下,主要功能是安装 conda 和创建环境,只需要运行一遍即可。

复制代码
@echo off

echo Installing Miniconda...
curl https://repo.anaconda.com/miniconda/Miniconda3-latest-Windows-x86_64.exe -o miniconda.exe
start /wait "" miniconda.exe /SILENT /AddToPath=1
del miniconda.exe

echo Installing Git for Windows...
curl -L https://mirror.ghproxy.com/https://github.com/git-for-windows/git/releases/download/v2.43.0.windows.1/Git-2.43.0-64-bit.exe -o git-install.exe
start /wait "" git-install.exe /SILENT /AddToPath=1
del git-install.exe

echo Cloning the repository...
git clone https://mirror.ghproxy.com/https://github.com/xtekky/gpt4free
cd gpt4free
conda  activate gpt4free && pip install -r requirements.txt && pip install g4f

第二个 win_start.bat,内容如下,主要功能是启动服务,需要启动的时候点击运行。

复制代码
@echo off

echo Setting G4F_PROXY environment variable...
setx G4F_PROXY "http://127.0.0.1:7890"

echo Running the application...
cd gpt4free
conda activate gpt4free && python g4f/gui/run.py

浏览器访问:http://127.0.0.1:8080 即可。

Linux/Mac 一键启动脚本

顺便完善下 Linux/Mac 的脚本内容。

第一个 mac_install_env.sh,内容如下,主要功能是安装 conda 和创建环境,只需要运行一遍即可。

复制代码
#! /bin/bash


wget https://mirrors.tuna.tsinghua.edu.cn/anaconda/miniconda/Miniconda3-py38_22.11.1-1-Linux-x86_64.sh 
chmod +x Miniconda3-py38_22.11.1-1-Linux-x86_64.sh
./Miniconda3-py38_22.11.1-1-Linux-x86_64.sh -b && /root/miniconda3/bin/conda init bash && /root/miniconda3/bin/conda clean -ya
# 安装 gpt4free 环境
git clone https://mirror.ghproxy.com/https://github.com/xtekky/gpt4free
cd gpt4free
conda create -n gpt4free python=3.9
source activate gpt4free && pip install -r requirements.txt && pip install g4f

第二个 mac_start.sh,内容如下,主要功能是启动服务,需要启动的时候运行。

复制代码
#! /bin/bash
cd gpt4free
export G4F_PROXY=http://127.0.0.1:7890
source activate gpt4free && python g4f/gui/run.py

Linux/Mac .sh 脚本运行方法:

复制代码
# 给予可执行权限
chmod +x mac_install_env.sh mac_start.sh 
# 运行一遍即可
bash mac_install_env.sh
# 启动服务运行它
bash mac_start.sh 
相关推荐
itme26813 分钟前
解决cocos 2dx/creator2.4在ios18下openURL无法调用的问题
macos·objective-c·cocoa
米粉030513 分钟前
深入剖析Nginx:从入门到高并发架构实战
java·运维·nginx·架构
huangyuchi.30 分钟前
【Linux】LInux下第一个程序:进度条
linux·运维·服务器·笔记·进度条·c/c++
蔡蓝31 分钟前
设计模式-建造者模式
服务器·设计模式·建造者模式
搬码临时工37 分钟前
外网访问内网服务器常用的三种简单操作步骤方法,本地搭建网址轻松让公网连接
服务器·网络·智能路由器
moongoblin1 小时前
行业赋能篇-2-能源行业安全运维升级
运维·安全·协作
帽儿山的枪手1 小时前
程序员必掌握的iptables五表五链
linux·网络协议
西阳未落1 小时前
Linux(14)——库的制作与原理
linux
极简网络科技1 小时前
Docker、Wsl 打包迁移环境
运维·docker·容器
黑客老李1 小时前
JavaSec | SpringAOP 链学习分析
java·运维·服务器·开发语言·学习·apache·memcached