Dorado607 commited on
Commit
d51d42a
1 Parent(s): 6a65971

update to the latest version

Browse files
.gitignore ADDED
@@ -0,0 +1,146 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ pip-wheel-metadata/
24
+ share/python-wheels/
25
+ *.egg-info/
26
+ .installed.cfg
27
+ *.egg
28
+ MANIFEST
29
+ history/
30
+ index/
31
+
32
+ # PyInstaller
33
+ # Usually these files are written by a python script from a template
34
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
35
+ *.manifest
36
+ *.spec
37
+
38
+ # Installer logs
39
+ pip-log.txt
40
+ pip-delete-this-directory.txt
41
+
42
+ # Unit test / coverage reports
43
+ htmlcov/
44
+ .tox/
45
+ .nox/
46
+ .coverage
47
+ .coverage.*
48
+ .cache
49
+ nosetests.xml
50
+ coverage.xml
51
+ *.cover
52
+ *.py,cover
53
+ .hypothesis/
54
+ .pytest_cache/
55
+
56
+ # Translations
57
+ *.mo
58
+ *.pot
59
+
60
+ # Django stuff:
61
+ *.log
62
+ local_settings.py
63
+ db.sqlite3
64
+ db.sqlite3-journal
65
+
66
+ # Flask stuff:
67
+ instance/
68
+ .webassets-cache
69
+
70
+ # Scrapy stuff:
71
+ .scrapy
72
+
73
+ # Sphinx documentation
74
+ docs/_build/
75
+
76
+ # PyBuilder
77
+ target/
78
+
79
+ # Jupyter Notebook
80
+ .ipynb_checkpoints
81
+
82
+ # IPython
83
+ profile_default/
84
+ ipython_config.py
85
+
86
+ # pyenv
87
+ .python-version
88
+
89
+ # pipenv
90
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
91
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
92
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
93
+ # install all needed dependencies.
94
+ #Pipfile.lock
95
+
96
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow
97
+ __pypackages__/
98
+
99
+ # Celery stuff
100
+ celerybeat-schedule
101
+ celerybeat.pid
102
+
103
+ # SageMath parsed files
104
+ *.sage.py
105
+
106
+ # Environments
107
+ .env
108
+ .venv
109
+ env/
110
+ venv/
111
+ ENV/
112
+ env.bak/
113
+ venv.bak/
114
+
115
+ # Spyder project settings
116
+ .spyderproject
117
+ .spyproject
118
+
119
+ # Rope project settings
120
+ .ropeproject
121
+
122
+ # mkdocs documentation
123
+ /site
124
+
125
+ # mypy
126
+ .mypy_cache/
127
+ .dmypy.json
128
+ dmypy.json
129
+
130
+ # Pyre type checker
131
+ .pyre/
132
+
133
+ # Mac system file
134
+ **/.DS_Store
135
+
136
+ #vscode
137
+ .vscode
138
+
139
+ # 配置文件/模型文件
140
+ api_key.txt
141
+ config.json
142
+ auth.json
143
+ .models/
144
+ lora/
145
+ .idea
146
+ templates/*
README.md CHANGED
@@ -1,142 +1,9 @@
1
- <div align="right">
2
- <!-- 语言: -->
3
- 简体中文 | <a title="English" href="./readme/README_en.md">English</a> | <a title="Japanese" href="./readme/README_ja.md">日本語</a>
4
- </div>
5
-
6
- <h1 align="center">川虎 Chat 🐯 Chuanhu Chat</h1>
7
- <div align="center">
8
- <a href="https://github.com/GaiZhenBiao/ChuanhuChatGPT">
9
- <img src="https://github.com/GaiZhenbiao/ChuanhuChatGPT/assets/70903329/aca3a7ec-4f1d-4667-890c-a6f47bf08f63" alt="Logo" height="156">
10
- </a>
11
-
12
- <p align="center">
13
- <h3>为ChatGPT等多种LLM提供了一个轻快好用的Web图形界面和众多附加功能</h3>
14
- <p align="center">
15
- <a href="https://github.com/GaiZhenbiao/ChuanhuChatGPT/blob/main/LICENSE">
16
- <img alt="Tests Passing" src="https://img.shields.io/github/license/GaiZhenbiao/ChuanhuChatGPT" />
17
- </a>
18
- <a href="https://gradio.app/">
19
- <img alt="GitHub Contributors" src="https://img.shields.io/badge/Base-Gradio-fb7d1a?style=flat" />
20
- </a>
21
- <a href="https://t.me/tkdifferent">
22
- <img alt="GitHub pull requests" src="https://img.shields.io/badge/Telegram-Group-blue.svg?logo=telegram" />
23
- </a>
24
- <p>
25
- 流式传输 / 无限对话 / 保存对话 / 预设Prompt集 / 联网搜索 / 根据文件回答 <br />
26
- 渲染LaTeX / 渲染表格 / 代码高亮 / 自动亮暗色切换 / 自适应界面 / “小而美”的体验 <br />
27
- 自定义api-Host / 多参数可调 / 多API Key均衡负载 / 多用户显示 / 适配GPT-4 / 支持本地部署LLM
28
- </p>
29
- <a href="https://www.bilibili.com/video/BV1mo4y1r7eE"><strong>视频教程</strong></a>
30
- ·
31
- <a href="https://www.bilibili.com/video/BV1184y1w7aP"><strong>2.0介绍视频</strong></a>
32
- ||
33
- <a href="https://huggingface.co/spaces/JohnSmith9982/ChuanhuChatGPT"><strong>在线体验</strong></a>
34
- ·
35
- <a href="https://huggingface.co/login?next=%2Fspaces%2FJohnSmith9982%2FChuanhuChatGPT%3Fduplicate%3Dtrue"><strong>一键部署</strong></a>
36
- </p>
37
- <p align="center">
38
- <img alt="Animation Demo" src="https://user-images.githubusercontent.com/51039745/226255695-6b17ff1f-ea8d-464f-b69b-a7b6b68fffe8.gif" />
39
- </p>
40
- </p>
41
- </div>
42
-
43
- ## 目录
44
-
45
- | [支持模型](#支持模型) | [使用技巧](#使用技巧) | [安装方式](https://github.com/GaiZhenbiao/ChuanhuChatGPT/wiki/使用教程) | [常见问题](https://github.com/GaiZhenbiao/ChuanhuChatGPT/wiki/常见问题) | [给作者买可乐🥤](#捐款) |
46
- | ------------------ | ------------------ | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------- |
47
-
48
- ## 支持模型
49
-
50
- **通过API调用的语言模型**:
51
-
52
- - [ChatGPT](https://chat.openai.com) ([GPT-4](https://openai.com/product/gpt-4))
53
- - [Google PaLM](https://developers.generativeai.google/products/palm)
54
- - [Inspur Yuan 1.0](https://air.inspur.com/home)
55
- - [MiniMax](https://api.minimax.chat/)
56
- - [XMChat](https://github.com/MILVLG/xmchat)
57
-
58
- **本地部署语言模型**:
59
-
60
- - [ChatGLM](https://github.com/THUDM/ChatGLM-6B) ([ChatGLM2](https://github.com/THUDM/ChatGLM2-6B))
61
- - [LLaMA](https://github.com/facebookresearch/llama)
62
- - [StableLM](https://github.com/Stability-AI/StableLM)
63
- - [MOSS](https://github.com/OpenLMLab/MOSS)
64
-
65
- ## 使用技巧
66
-
67
- - 使用System Prompt可以很有效地设定前提条件。
68
- - 使用Prompt模板功能时,选择Prompt模板集合文件,然后从下拉菜单中选择想要的prompt。
69
- - 如果回答不满意,可以使用 `重新生成`按钮再试一次
70
- - 输入框支持换行,按 `shift enter`即可。
71
- - 可以在输入框按上下箭头在输入历史之间切换
72
- - 部署到服务器:在 `config.json` 中设置 `"server_name": "0.0.0.0", "server_port": <你的端口号>,`。
73
- - 获取公共链接:在 `config.json` 中设置 `"share": true,`。注意程序必须在运行,才能通过公共链接访问。
74
- - 在Hugging Face上使用:建议在右上角 **复制Space** 再使用,这样App反应可能会快一点。
75
-
76
- ## 快速上手
77
-
78
- ```shell
79
- git clone https://github.com/GaiZhenbiao/ChuanhuChatGPT.git
80
- cd ChuanhuChatGPT
81
- pip install -r requirements.txt
82
- ```
83
-
84
- 然后,在项目文件夹中复制一份 `config_example.json`,并将其重命名为 `config.json`,在其中填入 `API-Key` 等设置。
85
-
86
- ```shell
87
- python ChuanhuChatbot.py
88
- ```
89
-
90
- 一个浏览器窗口将会自动打开,此时您将可以使用 **川虎Chat** 与ChatGPT或其他模型进行对话。
91
-
92
- > **Note**
93
- >
94
- > 具体详尽的安装教程和使用教程请查看[本项目的wiki页面](https://github.com/GaiZhenbiao/ChuanhuChatGPT/wiki/使用教程)。
95
-
96
- ## 疑难杂症解决
97
-
98
- 在遇到各种问题查阅相关信息前,您可以先尝试手动拉取本项目的最新更改并更新依赖库,然后重试。步骤为:
99
-
100
- 1. 点击网页上的 `Download ZIP` 下载最新代码,或
101
- ```shell
102
- git pull https://github.com/GaiZhenbiao/ChuanhuChatGPT.git main -f
103
- ```
104
- 2. 尝试再次��装依赖(可能本项目引入了新的依赖)
105
- ```
106
- pip install -r requirements.txt
107
- ```
108
-
109
- 很多时候,这样就可以解决问题。
110
-
111
- 如果问题仍然存在,请查阅该页面:[常见问题](https://github.com/GaiZhenbiao/ChuanhuChatGPT/wiki/常见问题)
112
-
113
- 该页面列出了**几乎所有**您可能遇到的各种问题,包括如何配置代理,以及遇到问题后您该采取的措施,**请务必认真阅读**。
114
-
115
- ## 了解更多
116
-
117
- 若需了解更多信息,请查看我们的 [wiki](https://github.com/GaiZhenbiao/ChuanhuChatGPT/wiki):
118
-
119
- - [想要做出贡献?](https://github.com/GaiZhenbiao/ChuanhuChatGPT/wiki/贡献指南)
120
- - [项目更新情况?](https://github.com/GaiZhenbiao/ChuanhuChatGPT/wiki/更新日志)
121
- - [二次开发许可?](https://github.com/GaiZhenbiao/ChuanhuChatGPT/wiki/使用许可)
122
- - [如何引用项目?](https://github.com/GaiZhenbiao/ChuanhuChatGPT/wiki/使用许可#如何引用该项目)
123
-
124
- ## Starchart
125
-
126
- [![Star History Chart](https://api.star-history.com/svg?repos=GaiZhenbiao/ChuanhuChatGPT&type=Date)](https://star-history.com/#GaiZhenbiao/ChuanhuChatGPT&Date)
127
-
128
- ## Contributors
129
-
130
- <a href="https://github.com/GaiZhenbiao/ChuanhuChatGPT/graphs/contributors">
131
- <img src="https://contrib.rocks/image?repo=GaiZhenbiao/ChuanhuChatGPT" />
132
- </a>
133
-
134
- ## 捐款
135
-
136
- 🐯如果觉得这个软件对你有所帮助,欢迎请作者喝可乐、喝咖啡~
137
-
138
- 联系作者:请去[我的bilibili账号](https://space.bilibili.com/29125536)私信我。
139
-
140
- <a href="https://www.buymeacoffee.com/ChuanhuChat" ><img src="https://img.buymeacoffee.com/button-api/?text=Buy me a coffee&emoji=&slug=ChuanhuChat&button_colour=219d53&font_colour=ffffff&font_family=Poppins&outline_colour=ffffff&coffee_colour=FFDD00" alt="Buy Me A Coffee" width="250"></a>
141
-
142
- <img width="250" alt="image" src="https://user-images.githubusercontent.com/51039745/226920291-e8ec0b0a-400f-4c20-ac13-dafac0c3aeeb.JPG">
 
1
+ title: ChuanhuChatGPT
2
+ emoji: 🐯
3
+ colorFrom: green
4
+ colorTo: red
5
+ sdk: gradio
6
+ sdk_version: 3.36.1
7
+ app_file: ChuanhuChatbot.py
8
+ pinned: false
9
+ license: gpl-3.0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
README_origin.md ADDED
@@ -0,0 +1,142 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div align="right">
2
+ <!-- 语言: -->
3
+ 简体中文 | <a title="English" href="./readme/README_en.md">English</a> | <a title="Japanese" href="./readme/README_ja.md">日本語</a>
4
+ </div>
5
+
6
+ <h1 align="center">川虎 Chat 🐯 Chuanhu Chat</h1>
7
+ <div align="center">
8
+ <a href="https://github.com/GaiZhenBiao/ChuanhuChatGPT">
9
+ <img src="https://github.com/GaiZhenbiao/ChuanhuChatGPT/assets/70903329/aca3a7ec-4f1d-4667-890c-a6f47bf08f63" alt="Logo" height="156">
10
+ </a>
11
+
12
+ <p align="center">
13
+ <h3>为ChatGPT等多种LLM提供了一个轻快好用的Web图形界面和众多附加功能</h3>
14
+ <p align="center">
15
+ <a href="https://github.com/GaiZhenbiao/ChuanhuChatGPT/blob/main/LICENSE">
16
+ <img alt="Tests Passing" src="https://img.shields.io/github/license/GaiZhenbiao/ChuanhuChatGPT" />
17
+ </a>
18
+ <a href="https://gradio.app/">
19
+ <img alt="GitHub Contributors" src="https://img.shields.io/badge/Base-Gradio-fb7d1a?style=flat" />
20
+ </a>
21
+ <a href="https://t.me/tkdifferent">
22
+ <img alt="GitHub pull requests" src="https://img.shields.io/badge/Telegram-Group-blue.svg?logo=telegram" />
23
+ </a>
24
+ <p>
25
+ 流式传输 / 无限对话 / 保存对话 / 预设Prompt集 / 联网搜索 / 根据文件回答 <br />
26
+ 渲染LaTeX / 渲染表格 / 代码高亮 / 自动亮暗色切换 / 自适应界面 / “小而美”的体验 <br />
27
+ 自定义api-Host / 多参数可调 / 多API Key均衡负载 / 多用户显示 / 适配GPT-4 / 支持本地部署LLM
28
+ </p>
29
+ <a href="https://www.bilibili.com/video/BV1mo4y1r7eE"><strong>视频教程</strong></a>
30
+ ·
31
+ <a href="https://www.bilibili.com/video/BV1184y1w7aP"><strong>2.0介绍视频</strong></a>
32
+ ||
33
+ <a href="https://huggingface.co/spaces/JohnSmith9982/ChuanhuChatGPT"><strong>在线体验</strong></a>
34
+ ·
35
+ <a href="https://huggingface.co/login?next=%2Fspaces%2FJohnSmith9982%2FChuanhuChatGPT%3Fduplicate%3Dtrue"><strong>一键部署</strong></a>
36
+ </p>
37
+ <p align="center">
38
+ <img alt="Animation Demo" src="https://user-images.githubusercontent.com/51039745/226255695-6b17ff1f-ea8d-464f-b69b-a7b6b68fffe8.gif" />
39
+ </p>
40
+ </p>
41
+ </div>
42
+
43
+ ## 目录
44
+
45
+ | [支持模型](#支持模型) | [使用技巧](#使用技巧) | [安装方式](https://github.com/GaiZhenbiao/ChuanhuChatGPT/wiki/使用教程) | [常见问题](https://github.com/GaiZhenbiao/ChuanhuChatGPT/wiki/常见问题) | [给作者买可乐🥤](#捐款) |
46
+ | ------------------ | ------------------ | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------- |
47
+
48
+ ## 支持模型
49
+
50
+ **通过API调用的语言模型**:
51
+
52
+ - [ChatGPT](https://chat.openai.com) ([GPT-4](https://openai.com/product/gpt-4))
53
+ - [Google PaLM](https://developers.generativeai.google/products/palm)
54
+ - [Inspur Yuan 1.0](https://air.inspur.com/home)
55
+ - [MiniMax](https://api.minimax.chat/)
56
+ - [XMChat](https://github.com/MILVLG/xmchat)
57
+
58
+ **本地部署语言模型**:
59
+
60
+ - [ChatGLM](https://github.com/THUDM/ChatGLM-6B) ([ChatGLM2](https://github.com/THUDM/ChatGLM2-6B))
61
+ - [LLaMA](https://github.com/facebookresearch/llama)
62
+ - [StableLM](https://github.com/Stability-AI/StableLM)
63
+ - [MOSS](https://github.com/OpenLMLab/MOSS)
64
+
65
+ ## 使用技巧
66
+
67
+ - 使用System Prompt可以很有效地设定前提条件。
68
+ - 使用Prompt模板功能时,选择Prompt模板集合文件,然后从下拉菜单中选择想要的prompt。
69
+ - 如果回答不满意,可以使用 `重新生成`按钮再试一次
70
+ - 输入框支持换行,按 `shift enter`即可。
71
+ - 可以在输入框按上下箭头在输入历史之间切换
72
+ - 部署到服务器:在 `config.json` 中设置 `"server_name": "0.0.0.0", "server_port": <你的端口号>,`。
73
+ - 获取公共链接:在 `config.json` 中设置 `"share": true,`。注意程序必须在运行,才能通过公共链接访问。
74
+ - 在Hugging Face上使用:建议在右上角 **复制Space** 再使用,这样App反应可能会快一点。
75
+
76
+ ## 快速上手
77
+
78
+ ```shell
79
+ git clone https://github.com/GaiZhenbiao/ChuanhuChatGPT.git
80
+ cd ChuanhuChatGPT
81
+ pip install -r requirements.txt
82
+ ```
83
+
84
+ 然后,在项目文件夹中复制一份 `config_example.json`,并将其重命名为 `config.json`,在其中填入 `API-Key` 等设置。
85
+
86
+ ```shell
87
+ python ChuanhuChatbot.py
88
+ ```
89
+
90
+ 一个浏览器窗口将会自动打开,此时您将可以使用 **川虎Chat** 与ChatGPT或其他模型进行对话。
91
+
92
+ > **Note**
93
+ >
94
+ > 具体详尽的安装教程和使用教程请查看[本项目的wiki页面](https://github.com/GaiZhenbiao/ChuanhuChatGPT/wiki/使用教程)。
95
+
96
+ ## 疑难杂症解决
97
+
98
+ 在遇到各种问题查阅相关信息前,您可以先尝试手动拉取本项目的最新更改并更新依赖库,然后重试。步骤为:
99
+
100
+ 1. 点击网页上的 `Download ZIP` 下载最新代码,或
101
+ ```shell
102
+ git pull https://github.com/GaiZhenbiao/ChuanhuChatGPT.git main -f
103
+ ```
104
+ 2. 尝试再次��装依赖(可能本项目引入了新的依赖)
105
+ ```
106
+ pip install -r requirements.txt
107
+ ```
108
+
109
+ 很多时候,这样就可以解决问题。
110
+
111
+ 如果问题仍然存在,请查阅该页面:[常见问题](https://github.com/GaiZhenbiao/ChuanhuChatGPT/wiki/常见问题)
112
+
113
+ 该页面列出了**几乎所有**您可能遇到的各种问题,包括如何配置代理,以及遇到问题后您该采取的措施,**请务必认真阅读**。
114
+
115
+ ## 了解更多
116
+
117
+ 若需了解更多信息,请查看我们的 [wiki](https://github.com/GaiZhenbiao/ChuanhuChatGPT/wiki):
118
+
119
+ - [想要做出贡献?](https://github.com/GaiZhenbiao/ChuanhuChatGPT/wiki/贡献指南)
120
+ - [项目更新情况?](https://github.com/GaiZhenbiao/ChuanhuChatGPT/wiki/更新日志)
121
+ - [二次开发许可?](https://github.com/GaiZhenbiao/ChuanhuChatGPT/wiki/使用许可)
122
+ - [如何引用项目?](https://github.com/GaiZhenbiao/ChuanhuChatGPT/wiki/使用许可#如何引用该项目)
123
+
124
+ ## Starchart
125
+
126
+ [![Star History Chart](https://api.star-history.com/svg?repos=GaiZhenbiao/ChuanhuChatGPT&type=Date)](https://star-history.com/#GaiZhenbiao/ChuanhuChatGPT&Date)
127
+
128
+ ## Contributors
129
+
130
+ <a href="https://github.com/GaiZhenbiao/ChuanhuChatGPT/graphs/contributors">
131
+ <img src="https://contrib.rocks/image?repo=GaiZhenbiao/ChuanhuChatGPT" />
132
+ </a>
133
+
134
+ ## 捐款
135
+
136
+ 🐯如果觉得这个软件对你有所帮助,欢迎请作者喝可乐、喝咖啡~
137
+
138
+ 联系作者:请去[我的bilibili账号](https://space.bilibili.com/29125536)私信我。
139
+
140
+ <a href="https://www.buymeacoffee.com/ChuanhuChat" ><img src="https://img.buymeacoffee.com/button-api/?text=Buy me a coffee&emoji=&slug=ChuanhuChat&button_colour=219d53&font_colour=ffffff&font_family=Poppins&outline_colour=ffffff&coffee_colour=FFDD00" alt="Buy Me A Coffee" width="250"></a>
141
+
142
+ <img width="250" alt="image" src="https://user-images.githubusercontent.com/51039745/226920291-e8ec0b0a-400f-4c20-ac13-dafac0c3aeeb.JPG">
assets/html/billing_info.html ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ <b>{label}</b>
2
+ <div class="progress-bar">
3
+ <div class="progress" style="width: {usage_percent}%;">
4
+ <span class="progress-text">{usage_percent}%</span>
5
+ </div>
6
+ </div>
7
+ <div style="display: flex; justify-content: space-between;">
8
+ <span>${rounded_usage}</span><span>${usage_limit}</span>
9
+ </div>
assets/html/update.html ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div id="toast-update">
2
+ <div id="check-chuanhu-update">
3
+ <p style="display:none">
4
+ <span id="current-version">{current_version}</span>
5
+ <span id="version-time">{version_time}</span>
6
+ </p>
7
+ <p id="version-info-title">
8
+ Latest Version: <a href="https://github.com/gaizhenbiao/chuanhuchatgpt/releases/latest" target="_blank"
9
+ id="latest-version-title" style="text-decoration: none;">getting latest version...</a>
10
+ </p>
11
+ <div id="release-note-wrap">
12
+ <div class="release-note-content" id="release-note-content">
13
+ Getting Release Note...
14
+ </div>
15
+ </div>
16
+ <div id="goto-update-btn" class="btn-update-group">
17
+ <button class="btn-update lg secondary svelte-1ipelgc" id="cancel-button" onclick="cancelUpdate()">{cancel_btn}</button>
18
+ <button class="btn-update lg primary svelte-1ipelgc" id="update-button" onclick="getUpdate()">{update_btn}</button>
19
+ </div>
20
+ <div id="close-update-btn" class="btn-update-group hideK">
21
+ <button class="btn-update lg secondary svelte-1jrzxu" id="update-button" onclick="getUpdate()">{seenew_btn}</button>
22
+ <button class="btn-update lg primary svelte-1jrzxu" id="cancel-button" onclick="cancelUpdate()">{ok_btn}</button>
23
+ </div>
24
+ </div>
25
+ </div>
locale/ko_KR.json ADDED
@@ -0,0 +1,86 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "未命名对话历史记录": "이름없는 대화 기록",
3
+ "在这里输入": "여기에 입력하세요",
4
+ "🧹 新的对话": "🧹 새로운 대화",
5
+ "🔄 重新生成": "🔄 재생성",
6
+ "🗑️ 删除最旧对话": "🗑️ 가장 오래된 대화 삭제",
7
+ "🗑️ 删除最新对话": "🗑️ 최신 대화 삭제",
8
+ "🗑️ 删除": "🗑️ 삭제",
9
+ "模型": "LLM 모델",
10
+ "多账号模式已开启,无需输入key,可直接开始对话": "다중 계정 모드가 활성화되어 있으므로 키를 입력할 필요가 없이 바로 대화를 시작할 수 있습니다",
11
+ "**发送消息** 或 **提交key** 以显示额度": "**메세지를 전송** 하거나 **Key를 입력**하여 크레딧 표시",
12
+ "选择模型": "모델 선택",
13
+ "选择LoRA模型": "LoRA 모델 선택",
14
+ "实时传输回答": "실시간 전송",
15
+ "单轮对话": "단일 대화",
16
+ "使用在线搜索": "온라인 검색 사용",
17
+ "选择回复语言(针对搜索&索引功能)": "답장 언어 선택 (검색 & 인덱스용)",
18
+ "上传索引文件": "업로드",
19
+ "双栏pdf": "2-column pdf",
20
+ "识别公式": "formula OCR",
21
+ "在这里输入System Prompt...": "여기에 시스템 프롬프트를 입력하세요...",
22
+ "加载Prompt模板": "프롬프트 템플릿 불러오기",
23
+ "选择Prompt模板集合文件": "프롬프트 콜렉션 파일 선택",
24
+ "🔄 刷新": "🔄 새로고침",
25
+ "从Prompt模板中加载": "프롬프트 템플릿에서 불러오기",
26
+ "保存/加载": "저장/불러오기",
27
+ "保存/加载对话历史记录": "대화 기록 저장/불러오기",
28
+ "从列表中加载对话": "리스트에서 대화 불러오기",
29
+ "设置文件名: 默认为.json,可选为.md": "파일 이름 설정: 기본값: .json, 선택: .md",
30
+ "设置保存文件名": "저장 파일명 설정",
31
+ "对话历史记录": "대화 기록",
32
+ "💾 保存对话": "💾 대화 저장",
33
+ "📝 导出为Markdown": "📝 마크다운으로 내보내기",
34
+ "默认保存于history文件夹": "히스토리 폴더에 기본 저장",
35
+ "高级": "고급",
36
+ "# ⚠️ 务必谨慎更改 ⚠️": "# ⚠️ 주의: 변경시 주의하세요. ⚠️",
37
+ "参数": "파라미터들",
38
+ "停止符,用英文逗号隔开...": "여기에 정지 토큰 입력, ','로 구분됨...",
39
+ "用于定位滥用行为": "악용 사례 파악에 활용됨",
40
+ "用户名": "사용자 이름",
41
+ "网络设置": "네트워크 설정",
42
+ "在这里输入API-Host...": "여기에 API host를 입력하세요...",
43
+ "🔄 切换API地址": "🔄 API 주소 변경",
44
+ "在这里输入代理地址...": "여기에 프록시 주소를 입력하세요...",
45
+ "代理地址(示例:http://127.0.0.1:10809)": "프록시 주소 (예: http://127.0.0.1:10809)",
46
+ "🔄 设置代理地址": "🔄 프록시 주소 설정",
47
+ "🔙 恢复默认网络设置": "🔙 네트워크 설정 초기화",
48
+ "🔄 检查更新...": "🔄 업데이트 확인...",
49
+ "取消": "취소",
50
+ "更新": "업데이트",
51
+ "详情": "상세",
52
+ "好": "예",
53
+ "川虎Chat 🚀": "Chuanhu Chat 🚀",
54
+ "开始实时传输回答……": "실시간 응답 출력 시작...",
55
+ "Token 计数: ": "토큰 수: ",
56
+ ",本次对话累计消耗了 ": ",이 대화의 전체 비용은 ",
57
+ "**获取API使用情况失败**": "**API 사용량 가져오기 실패**",
58
+ "**获取API使用情况失败**,需在填写`config.json`中正确填写sensitive_id": "**API 사용량 가져오기 실패**. `config.json`에 올바른 `sensitive_id`를 입력해야 합니다",
59
+ "**获取API使用情况失败**,sensitive_id错误或已过期": "**API 사용량 가져오기 실패**. sensitive_id가 잘못되었거나 만료되었습니다",
60
+ "**本月使用金额** ": "**이번 달 사용금액** ",
61
+ "本月使用金额": "이번 달 사용금액",
62
+ "获取API使用情况失败:": "API 사용량 가져오기 실패:",
63
+ "API密钥更改为了": "API 키가 변경되었습니다.",
64
+ "JSON解析错误,收到的内容: ": "JSON 파싱 에러, 응답: ",
65
+ "模型设置为了:": "설정된 모델: ",
66
+ "☹️发生了错误:": "☹️에러: ",
67
+ "获取对话时发生错误,请查看后台日志": "대화를 가져오는 중 에러가 발생했습니다. 백그라운드 로그를 확인하세요",
68
+ "请检查网络连接,或者API-Key是否有效。": "네트워크 연결 또는 API키가 유효한지 확인하세요",
69
+ "连接超时,无法获取对话。": "연결 시간 초과, 대화를 가져올 수 없습니다.",
70
+ "读取超时,无法获取对话。": "읽기 시간 초과, 대화를 가져올 수 없습니다.",
71
+ "代理错误,无法获取对话。": "프록시 에러, 대화를 가져올 수 없습니다.",
72
+ "SSL错误,无法获取对话。": "SSL 에러, 대화를 가져올 수 없습니다.",
73
+ "API key为空,请检查是��输入正确。": "API 키가 비어 있습니다. 올바르게 입력되었는지 확인하십세요.",
74
+ "请输入对话内容。": "대화 내용을 입력하세요.",
75
+ "账单信息不适用": "청구 정보를 가져올 수 없습니다",
76
+ "由Bilibili [土川虎虎虎](https://space.bilibili.com/29125536)、[明昭MZhao](https://space.bilibili.com/24807452) 和 [Keldos](https://github.com/Keldos-Li) 开发<br />访问川虎Chat的 [GitHub项目](https://github.com/GaiZhenbiao/ChuanhuChatGPT) 下载最新版脚本": "제작: Bilibili [土川虎虎虎](https://space.bilibili.com/29125536), [明昭MZhao](https://space.bilibili.com/24807452), [Keldos](https://github.com/Keldos-Li)\n\n최신 코드 다운로드: [GitHub](https://github.com/GaiZhenbiao/ChuanhuChatGPT)",
77
+ "切换亮暗色主题": "라이트/다크 테마 전환",
78
+ "您的IP区域:未知。": "IP 지역: 알 수 없음.",
79
+ "获取IP地理位置失败。原因:": "다음과 같은 이유로 IP 위치를 가져올 수 없습니다. 이유: ",
80
+ "。你仍然可以使用聊天功能。": ". 채팅 기능을 계속 사용할 수 있습니다.",
81
+ "您的IP区域:": "당신의 IP 지역: ",
82
+ "总结": "요약",
83
+ "生成内容总结中……": "콘텐츠 요약 생성중...",
84
+ "上传": "업로드",
85
+ "由于下面的原因,Google 拒绝返回 PaLM 的回答:\n\n": "구글은 다음과 같은 이유로 인해 PaLM의 응답을 거부합니다: \n\n"
86
+ }
locale/sv-SE.json ADDED
@@ -0,0 +1,84 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "未命名对话历史记录": "Onämnd Dialoghistorik",
3
+ "在这里输入": "Skriv in här",
4
+ "🧹 新的对话": "🧹 Ny Dialog",
5
+ "🔄 重新生成": "🔄 Regenerera",
6
+ "🗑️ 删除最旧对话": "🗑️ Ta bort äldsta dialogen",
7
+ "🗑️ 删除最新对话": "🗑️ Ta bort senaste dialogen",
8
+ "模型": "Modell",
9
+ "多账号模式已开启,无需输入key,可直接开始对话": "Flerkontoläge är aktiverat, ingen nyckel behövs, du kan starta dialogen direkt",
10
+ "**发送消息** 或 **提交key** 以显示额度": "**Skicka meddelande** eller **Skicka in nyckel** för att visa kredit",
11
+ "选择模型": "Välj Modell",
12
+ "选择LoRA模型": "Välj LoRA Modell",
13
+ "实时传输回答": "Strömmande utdata",
14
+ "单轮对话": "Enkel dialog",
15
+ "使用在线搜索": "Använd online-sökning",
16
+ "选择回复语言(针对搜索&索引功能)": "Välj svarspråk (för sök- och indexfunktion)",
17
+ "上传索引文件": "Ladda upp",
18
+ "双栏pdf": "Två-kolumns pdf",
19
+ "识别公式": "Formel OCR",
20
+ "在这里输入System Prompt...": "Skriv in System Prompt här...",
21
+ "加载Prompt模板": "Ladda Prompt-mall",
22
+ "选择Prompt模板集合文件": "Välj Prompt-mall Samlingsfil",
23
+ "🔄 刷新": "🔄 Uppdatera",
24
+ "从Prompt模板中加载": "Ladda från Prompt-mall",
25
+ "保存/加载": "Spara/Ladda",
26
+ "保存/加载对话历史记录": "Spara/Ladda Dialoghistorik",
27
+ "从列表中加载对话": "Ladda dialog från lista",
28
+ "设置文件名: 默认为.json,可选为.md": "Ställ in filnamn: standard är .json, valfritt är .md",
29
+ "设置保存文件名": "Ställ in sparfilnamn",
30
+ "对话历史记录": "Dialoghistorik",
31
+ "💾 保存对话": "💾 Spara Dialog",
32
+ "📝 导出为Markdown": "📝 Exportera som Markdown",
33
+ "默认保存于history文件夹": "Sparas som standard i mappen history",
34
+ "高级": "Avancerat",
35
+ "# ⚠️ 务必谨慎更改 ⚠️": "# ⚠️ Var försiktig med ändringar. ⚠️",
36
+ "参数": "Parametrar",
37
+ "停止符,用英文逗号隔开...": "Skriv in stopptecken här, separerade med kommatecken...",
38
+ "用于定位滥用行为": "Används för att lokalisera missbruk",
39
+ "用户名": "Användarnamn",
40
+ "网络设置": "Nätverksinställningar",
41
+ "在这里输入API-Host...": "Skriv in API-Host här...",
42
+ "🔄 切换API地址": "🔄 Byt API-adress",
43
+ "在这里输入代理地址...": "Skriv in proxyadress här...",
44
+ "代理地址(示例:http://127.0.0.1:10809)": "Proxyadress (exempel: http://127.0.0.1:10809)",
45
+ "🔄 设置代理地址": "🔄 Ställ in Proxyadress",
46
+ "🔙 恢复网络默认设置": "🔙 Återställ Nätverksinställningar",
47
+ "🔄 检查更新...": "🔄 Sök efter uppdateringar...",
48
+ "取消": "Avbryt",
49
+ "更新": "Uppdatera",
50
+ "详情": "Detaljer",
51
+ "好": "OK",
52
+ "川虎Chat 🚀": "Chuanhu Chat 🚀",
53
+ "开始实时传输回答……": "Börjar strömma utdata...",
54
+ "Token 计数: ": "Tokenräkning: ",
55
+ ",本次对话累计消耗了 ": ", Total kostnad för denna dialog är ",
56
+ "**获取API使用情况失败**": "**Misslyckades med att hämta API-användning**",
57
+ "**获取API使用情况失败**,需在填写`config.json`中正确填写sensitive_id": "**Misslyckades med att hämta API-användning**, korrekt sensitive_id behövs i `config.json`",
58
+ "**获取API使用情况失败**,sensitive_id错误或已过期": "**Misslyckades med att hämta API-användning**, felaktig eller utgången sensitive_id",
59
+ "**本月使用金额** ": "**Månadens användning** ",
60
+ "本月使用金额": "Månadens användning",
61
+ "获取API使用情况失败:": "Misslyckades med att hämta API-användning:",
62
+ "API密钥更改为了": "API-nyckeln har ändrats till",
63
+ "JSON解析错误,收到的内容: ": "JSON-tolkningsfel, mottaget innehåll: ",
64
+ "模型设置为了:": "Modellen är inställd på: ",
65
+ "☹️发生了错误:": "☹️Fel: ",
66
+ "获取对话时发生错误,请查看后台日志": "Ett fel uppstod när dialogen hämtades, kontrollera bakgrundsloggen",
67
+ "请检查网络连接,或者API-Key是否有效。": "Kontrollera nätverksanslutningen eller om API-nyckeln är giltig.",
68
+ "连接超时,无法获取对话。": "Anslutningen tog för lång tid, kunde inte hämta dialogen.",
69
+ "读取超时,无法获取对话。": "Läsningen tog för lång tid, kunde inte hämta dialogen.",
70
+ "代理错误,无法获取对话。": "Proxyfel, kunde inte hämta dialogen.",
71
+ "SSL错误,无法获取对话。": "SSL-fel, kunde inte hämta dialogen.",
72
+ "API key为空,请检查是否输入正确。": "API-nyckeln är tom, kontrollera om den är korrekt inmatad.",
73
+ "请输入对话内容。": "Ange dialoginnehåll.",
74
+ "账单信���不适用": "Faktureringsinformation är inte tillämplig",
75
+ "由Bilibili [土川虎虎虎](https://space.bilibili.com/29125536)、[明昭MZhao](https://space.bilibili.com/24807452) 和 [Keldos](https://github.com/Keldos-Li) 开发<br />访问川虎Chat的 [GitHub项目](https://github.com/GaiZhenbiao/ChuanhuChatGPT) 下载最新版脚本": "Utvecklad av Bilibili [土川虎虎虎](https://space.bilibili.com/29125536), [明昭MZhao](https://space.bilibili.com/24807452) och [Keldos](https://github.com/Keldos-Li)\n\nLadda ner senaste koden från [GitHub](https://github.com/GaiZhenbiao/ChuanhuChatGPT)",
76
+ "切换亮暗色主题": "Byt ljus/mörk tema",
77
+ "您的IP区域:未知。": "Din IP-region: Okänd.",
78
+ "获取IP地理位置失败。原因:": "Misslyckades med att hämta IP-plats. Orsak: ",
79
+ "。你仍然可以使用聊天功能。": ". Du kan fortfarande använda chattfunktionen.",
80
+ "您的IP区域:": "Din IP-region: ",
81
+ "总结": "Sammanfatta",
82
+ "生成内容总结中……": "Genererar innehållssammanfattning...",
83
+ "由于下面的原因,Google 拒绝返回 PaLM 的回答:\n\n": "På grund av följande skäl vägrar Google att ge ett svar till PaLM: \n\n"
84
+ }
modules/models/Google_PaLM.py ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from .base_model import BaseLLMModel
2
+ import google.generativeai as palm
3
+
4
+ class Google_PaLM_Client(BaseLLMModel):
5
+ def __init__(self, model_name, api_key, user_name="") -> None:
6
+ super().__init__(model_name=model_name, user=user_name)
7
+ self.api_key = api_key
8
+
9
+ def _get_palm_style_input(self):
10
+ new_history = []
11
+ for item in self.history:
12
+ if item["role"] == "user":
13
+ new_history.append({'author': '1', 'content': item["content"]})
14
+ else:
15
+ new_history.append({'author': '0', 'content': item["content"]})
16
+ return new_history
17
+
18
+ def get_answer_at_once(self):
19
+ palm.configure(api_key=self.api_key)
20
+ messages = self._get_palm_style_input()
21
+ response = palm.chat(context=self.system_prompt, messages=messages, temperature=self.temperature, top_p=self.top_p)
22
+ if response.last is not None:
23
+ return response.last, len(response.last)
24
+ else:
25
+ reasons = '\n\n'.join(reason['reason'].name for reason in response.filters)
26
+ return "由于下面的原因,Google 拒绝返回 PaLM 的回答:\n\n" + reasons, 0
modules/models/azure.py ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from langchain.chat_models import AzureChatOpenAI
2
+ import os
3
+
4
+ from .base_model import Base_Chat_Langchain_Client
5
+
6
+ # load_config_to_environ(["azure_openai_api_key", "azure_api_base_url", "azure_openai_api_version", "azure_deployment_name"])
7
+
8
+ class Azure_OpenAI_Client(Base_Chat_Langchain_Client):
9
+ def setup_model(self):
10
+ # inplement this to setup the model then return it
11
+ return AzureChatOpenAI(
12
+ openai_api_base=os.environ["AZURE_OPENAI_API_BASE_URL"],
13
+ openai_api_version=os.environ["AZURE_OPENAI_API_VERSION"],
14
+ deployment_name=os.environ["AZURE_DEPLOYMENT_NAME"],
15
+ openai_api_key=os.environ["AZURE_OPENAI_API_KEY"],
16
+ openai_api_type="azure",
17
+ )
readme/README_en.md CHANGED
@@ -1,6 +1,6 @@
1
  <div align="right">
2
  <!-- Language: -->
3
- <a title="Chinese" href="../README.md">简体中文</a> | English | <a title="Japanese" href="README_ja.md">日本語</a>
4
  </div>
5
 
6
  <h1 align="center">川虎 Chat 🐯 Chuanhu Chat</h1>
 
1
  <div align="right">
2
  <!-- Language: -->
3
+ <a title="Chinese" href="../README_origin.md">简体中文</a> | English | <a title="Japanese" href="README_ja.md">日本語</a>
4
  </div>
5
 
6
  <h1 align="center">川虎 Chat 🐯 Chuanhu Chat</h1>
readme/README_ja.md CHANGED
@@ -1,6 +1,6 @@
1
  <div align="right">
2
  <!-- Language: -->
3
- <a title="Chinese" href="../README.md">简体中文</a> | <a title="English" href="README_en.md">English</a> | 日本語
4
  </div>
5
 
6
  <h1 align="center">川虎 Chat 🐯 Chuanhu Chat</h1>
 
1
  <div align="right">
2
  <!-- Language: -->
3
+ <a title="Chinese" href="../README_origin.md">简体中文</a> | <a title="English" href="README_en.md">English</a> | 日本語
4
  </div>
5
 
6
  <h1 align="center">川虎 Chat 🐯 Chuanhu Chat</h1>
requirements_advanced.txt ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ transformers
2
+ huggingface_hub
3
+ torch
4
+ icetk
5
+ protobuf==3.19.0
6
+ git+https://github.com/OptimalScale/LMFlow.git
7
+ cpm-kernels
8
+ sentence_transformers
9
+ accelerate
10
+ sentencepiece
11
+ datasets