开源了,免费使用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 
相关推荐
大树8811 小时前
金刚石散热越强,管路越先见顶
大数据·运维·服务器·人工智能·ai
摇滚侠11 小时前
Linux CentOS7 rpm 安装 MySQL 5.7
linux·运维·mysql
霸道流氓气质11 小时前
领域驱动设计(DDD)在 Spring Boot 微服务中的实践指南
运维·spring boot·微服务
bush411 小时前
嵌入式linux学习记录十四、术语
linux·嵌入式
载数而行52011 小时前
Linux 11 动态监控指令top
linux
小宇宙Zz11 小时前
Maven依赖冲突
java·服务器·maven
qq_3692243311 小时前
Windows全系通用!ntdll.dll文件丢失、报错、闪退问题的完整排查与修复教程
windows·dll·dll修复·dll丢失·dll错误
AI创界者12 小时前
PilotTTS 一键整合包(Win/Mac):8G 显存畅跑,实测解锁情绪与副语言的精准控制
人工智能·macos·aigc·音视频
Inhand陈工12 小时前
基于台达PLC与映翰通IG502的智慧水产养殖精准投喂与远程运维解决方案
运维·人工智能·物联网·阿里云·信息与通信
酣大智12 小时前
ARP代理--工作原理
运维·网络·arp·arp代理