开源了,免费使用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 
相关推荐
释怀不想释怀13 分钟前
Linux文件上传(rz)和下载(sz)压缩(tar.gz)和解压(zip)
linux·运维·服务器
IOsetting21 分钟前
金山云主机添加开机路由
运维·服务器·开发语言·网络·php
kali-Myon22 分钟前
2025春秋杯网络安全联赛冬季赛-day1
java·sql·安全·web安全·ai·php·web
酉鬼女又兒27 分钟前
零基础入门Linux指南:每天一个Linux命令_sed
linux·运维·服务器
daad77730 分钟前
tcpdump_BPF
linux·测试工具·tcpdump
予枫的编程笔记34 分钟前
【Linux进阶篇】Linux网络配置+端口监听实战:ip/ss/iptables常用命令一次吃透
linux·iptables·网络配置·curl·端口监听·ping·ss命令
kali-Myon39 分钟前
2025春秋杯网络安全联赛冬季赛-day3
python·安全·web安全·ai·php·web·ctf
礼拜天没时间.40 分钟前
深入Docker架构——C/S模式解析
linux·docker·容器·架构·centos
-dcr43 分钟前
58.DevOps进阶
运维·devops
猫头虎1 小时前
如何使用Docker部署OpenClaw汉化中文版?
运维·人工智能·docker·容器·langchain·开源·aigc