Skip to content

Commit

Permalink
version 3.61
Browse files Browse the repository at this point in the history
  • Loading branch information
binary-sky committed Nov 23, 2023
1 parent fd72894 commit 32393a2
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 68 deletions.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ To translate this project to arbitrary language with GPT, read and run [`multi_l

功能(⭐= 近期新增功能) | 描述
--- | ---
[接入新模型](https://github.com/binary-husky/gpt_academic/wiki/%E5%A6%82%E4%BD%95%E5%88%87%E6%8D%A2%E6%A8%A1%E5%9E%8B)! | 百度[千帆](https://cloud.baidu.com/doc/WENXINWORKSHOP/s/Nlks5zkzu)与文心一言, [通义千问](https://modelscope.cn/models/qwen/Qwen-7B-Chat/summary),上海AI-Lab[书生](https://github.com/InternLM/InternLM),讯飞[星火](https://xinghuo.xfyun.cn/)[LLaMa2](https://huggingface.co/meta-llama/Llama-2-7b-chat-hf),智谱API,DALLE3
[接入新模型](https://github.com/binary-husky/gpt_academic/wiki/%E5%A6%82%E4%BD%95%E5%88%87%E6%8D%A2%E6%A8%A1%E5%9E%8B)! | 百度[千帆](https://cloud.baidu.com/doc/WENXINWORKSHOP/s/Nlks5zkzu)与文心一言, 通义千问[Qwen](https://modelscope.cn/models/qwen/Qwen-7B-Chat/summary),上海AI-Lab[书生](https://github.com/InternLM/InternLM),讯飞[星火](https://xinghuo.xfyun.cn/)[LLaMa2](https://huggingface.co/meta-llama/Llama-2-7b-chat-hf)[智谱API](https://open.bigmodel.cn/),DALLE3, [DeepseekCoder](https://coder.deepseek.com/)
润色、翻译、代码解释 | 一键润色、翻译、查找论文语法错误、解释代码
[自定义快捷键](https://www.bilibili.com/video/BV14s4y1E7jN) | 支持自定义快捷键
模块化设计 | 支持自定义强大的[插件](https://github.com/binary-husky/gpt_academic/tree/master/crazy_functions),插件支持[热更新](https://github.com/binary-husky/gpt_academic/wiki/%E5%87%BD%E6%95%B0%E6%8F%92%E4%BB%B6%E6%8C%87%E5%8D%97)
Expand Down Expand Up @@ -310,7 +310,6 @@ Tip:不指定文件直接点击 `载入对话历史存档` 可以查看历史h
- version 2.0: 引入模块化函数插件
- version 1.0: 基础功能

GPT Academic开发者QQ群:`610599535`

- 已知问题
- 某些浏览器翻译插件干扰此软件前端的运行
Expand All @@ -325,9 +324,12 @@ GPT Academic开发者QQ群:`610599535`

1. `master` 分支: 主分支,稳定版
2. `frontier` 分支: 开发分支,测试版
3. 如何接入其他大模型:[接入其他大模型](request_llms/README.md)

### V: GPT Academic开发者QQ群
GPT Academic开发者QQ群:`610599535`

### V:参考与学习
### VI:参考与学习

```
代码中参考了很多其他优秀项目中的设计,顺序不分先后:
Expand Down
82 changes: 19 additions & 63 deletions request_llms/README.md
Original file line number Diff line number Diff line change
@@ -1,79 +1,35 @@
# 如何使用其他大语言模型
P.S. 如果您按照以下步骤成功接入了新的大模型,欢迎发Pull Requests(如果您在自己接入新模型的过程中遇到困难,欢迎加README底部QQ群联系群主)

## ChatGLM

- 安装依赖 `pip install -r request_llms/requirements_chatglm.txt`
- 修改配置,在config.py中将LLM_MODEL的值改为"chatglm"
# 如何接入其他本地大语言模型

``` sh
LLM_MODEL = "chatglm"
```
- 运行!
``` sh
`python main.py`
```
1. 复制`request_llms/bridge_llama2.py`,重命名为你喜欢的名字

## Claude-Stack
2. 修改`load_model_and_tokenizer`方法,加载你的模型和分词器(去该模型官网找demo,复制粘贴即可)

- 请参考此教程获取 https://zhuanlan.zhihu.com/p/627485689
- 1、SLACK_CLAUDE_BOT_ID
- 2、SLACK_CLAUDE_USER_TOKEN
3. 修改`llm_stream_generator`方法,定义推理模型(去该模型官网找demo,复制粘贴即可)

- 把token加入config.py
4. 命令行测试
- 修改`tests/test_llms.py`(聪慧如您,只需要看一眼该文件就明白怎么修改了)
- 运行`python tests/test_llms.py`

## Newbing
5. 测试通过后,在`request_llms/bridge_all.py`中做最后的修改,把你的模型完全接入到框架中(聪慧如您,只需要看一眼该文件就明白怎么修改了)

- 使用cookie editor获取cookie(json)
- 把cookie(json)加入config.py (NEWBING_COOKIES)
6. 修改`LLM_MODEL`配置,然后运行`python main.py`,测试最后的效果

## Moss
- 使用docker-compose

## RWKV
- 使用docker-compose
# 如何接入其他在线大语言模型

## LLAMA
- 使用docker-compose
1. 复制`request_llms/bridge_zhipu.py`,重命名为你喜欢的名字

## 盘古
- 使用docker-compose
2. 修改`predict_no_ui_long_connection`

3. 修改`predict`

---
## Text-Generation-UI (TGUI,调试中,暂不可用)
4. 命令行测试
- 修改`tests/test_llms.py`(聪慧如您,只需要看一眼该文件就明白怎么修改了)
- 运行`python tests/test_llms.py`

### 1. 部署TGUI
``` sh
# 1 下载模型
git clone https://github.com/oobabooga/text-generation-webui.git
# 2 这个仓库的最新代码有问题,回滚到几周之前
git reset --hard fcda3f87767e642d1c0411776e549e1d3894843d
# 3 切换路径
cd text-generation-webui
# 4 安装text-generation的额外依赖
pip install accelerate bitsandbytes flexgen gradio llamacpp markdown numpy peft requests rwkv safetensors sentencepiece tqdm datasets git+https://github.com/huggingface/transformers
# 5 下载模型
python download-model.py facebook/galactica-1.3b
# 其他可选如 facebook/opt-1.3b
# facebook/galactica-1.3b
# facebook/galactica-6.7b
# facebook/galactica-120b
# facebook/pygmalion-1.3b 等
# 详情见 https://github.com/oobabooga/text-generation-webui
5. 测试通过后,在`request_llms/bridge_all.py`中做最后的修改,把你的模型完全接入到框架中(聪慧如您,只需要看一眼该文件就明白怎么修改了)

# 6 启动text-generation
python server.py --cpu --listen --listen-port 7865 --model facebook_galactica-1.3b
```

### 2. 修改config.py

``` sh
# LLM_MODEL格式: tgui:[模型]@[ws地址]:[ws端口] , 端口要和上面给定的端口一致
LLM_MODEL = "tgui:galactica-1.3b@localhost:7860"
```

### 3. 运行!
``` sh
cd chatgpt-academic
python main.py
```
6. 修改`LLM_MODEL`配置,然后运行`python main.py`,测试最后的效果
4 changes: 2 additions & 2 deletions version
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": 3.60,
"version": 3.61,
"show_feature": true,
"new_feature": "修复多个BUG <-> AutoGen多智能体插件测试版 <-> 修复本地模型在Windows下的加载BUG <-> 支持文心一言v4和星火v3 <-> 支持GLM3和智谱的API <-> 解决本地模型并发BUG <-> 支持动态追加基础功能按钮 <-> 新汇报PDF汇总页面 <-> 重新编译Gradio优化使用体验"
"new_feature": "修复潜在的多用户冲突问题 <-> 接入Deepseek Coder <-> AutoGen多智能体插件测试版 <-> 修复本地模型在Windows下的加载BUG <-> 支持文心一言v4和星火v3 <-> 支持GLM3和智谱的API <-> 解决本地模型并发BUG <-> 支持动态追加基础功能按钮"
}

0 comments on commit 32393a2

Please sign in to comment.