Compare commits

..

73 Commits

Author SHA1 Message Date
binary-husky
478f3a737c 修改rwkv的reset接口 2023-05-05 17:12:02 +08:00
binary-husky
b49ea55e24 Update README.md 2023-05-05 15:25:55 +08:00
binary-husky
7608c6c7ab Update README.md 2023-05-05 04:43:14 +08:00
binary-husky
ba6d91c5cc Update README.md 2023-05-05 04:42:42 +08:00
binary-husky
5de85153ba Update README.md 2023-05-05 04:35:15 +08:00
binary-husky
59a4bca053 加入LLAMA + 盘古 + RWKV本地模型 2023-05-05 04:31:31 +08:00
binary-husky
1034769c78 Update README.md 2023-05-05 00:34:20 +08:00
binary-husky
947f50b516 Update README.md 2023-05-05 00:32:49 +08:00
binary-husky
1434a28fa8 avoid dummy 2023-05-05 00:29:51 +08:00
binary-husky
78757411ca upload docker compose 2023-05-05 00:26:03 +08:00
binary-husky
9b8e7e933b Merge branch 'master' of github.com:binary-husky/chatgpt_academic 2023-05-04 23:29:25 +08:00
binary-husky
6da3289830 改进环境变量的读取 2023-05-04 23:29:19 +08:00
binary-husky
f6da72c9eb Merge pull request #678 from gwj12345/master
补充了"不能正常加载ChatGLM的参数"的解决方法
2023-05-04 22:59:31 +08:00
gwj1139
c17882af8a 补充了"不能正常加载ChatGLM的参数"的解决方法
补充了"不能正常加载ChatGLM的参数"的解决方法
2023-05-04 14:08:40 +08:00
binary-husky
9f7cf7c4d8 Merge pull request #677 from binary-husky/add-waifu
add waifu option
2023-05-04 02:39:44 +08:00
binary-husky
97de15dfbe add waifu 2023-05-04 02:34:17 +08:00
binary-husky
93801ff772 Merge pull request #674 from LiZheGuang/master
feat:把原有的解析react替换成解析整个前端
2023-05-04 01:37:14 +08:00
binary-husky
13f99fcab0 修改提示 2023-05-04 01:36:09 +08:00
binary-husky
30d16989b7 Merge pull request #662 from sperjar/master
自动编译Docker镜像并上传到ghcr
2023-05-04 01:32:52 +08:00
binary-husky
1a796a5ade Merge branch 'master' into sperjar-master 2023-05-04 01:32:20 +08:00
binary-husky
b7d3ed7135 rm docker image yml 2023-05-04 01:30:24 +08:00
LiZheGuang
5a1bbb3874 feat: 🎸 修改解析react文件 2023-05-03 01:41:31 +08:00
ZheGuangLi
3d3e54f0d1 Merge branch 'binary-husky:master' into master 2023-05-03 01:40:08 +08:00
LiZheGuang
bf75b29314 feat: 🎸 替换react 解析所有常见的前端项目 包含VUE 2023-05-03 01:38:40 +08:00
binary-husky
79cd98fc24 Merge pull request #672 from Keldos-Li/fixHTML
fix: specify encoding when saving HTML
2023-05-02 23:46:16 +08:00
Keldos
4b4836099d fix: specify encoding when saving HTML
Solve the possible issue of displaying garbled codes in macOS
2023-05-02 21:49:57 +08:00
binary-husky
b25d3e274a Update README.md 2023-05-02 18:18:34 +08:00
binary-husky
a96bf9af2f Update README.md 2023-05-02 17:33:59 +08:00
binary-husky
a69ef7f8c5 env read failure reminder 2023-05-02 15:33:07 +08:00
Your Name
896077009a 增加通用性 2023-05-02 14:54:51 +08:00
Your Name
988c5c24da Merge branch 'master' of https://github.com/sperjar/gpt_academic into sperjar-master 2023-05-02 14:26:46 +08:00
ReeInk
8865b232ca 修复:读取环境变量重定向URL格式 2023-05-02 00:12:35 +08:00
binary-husky
815d949e12 Update README.md 2023-05-01 23:36:26 +08:00
binary-husky
33cd7068fb Update config.py 2023-05-01 23:28:28 +08:00
binary-husky
96aceedd25 Merge pull request #666 from mldljyh/ko
Add a link  to the Korean version of gpt_academic (ko_gpt_academic) on the README.
2023-05-01 20:52:57 +08:00
jy.hyun
c2d8bfd8c7 fix README ko 2023-05-01 11:35:38 +09:00
jy.hyun
d85f9ee41b Add README ko 2023-05-01 11:34:02 +09:00
ReeInk
e5e3e0aa43 读取环境变量作为配置 2023-04-30 17:30:31 +08:00
ReeInk
f187a23dc1 Revert "加载环境变量作为配置"
This reverts commit 601c36e607.
2023-04-30 14:34:35 +08:00
ReeInk
601c36e607 加载环境变量作为配置 2023-04-29 19:55:40 +08:00
ReeInk
15b7cd6193 feat: build docker image automatically 2023-04-29 18:10:27 +08:00
binary-husky
9d3b01af75 尝试加入jittor本地模型 2023-04-29 16:46:59 +08:00
binary-husky
61ad51cf15 更新提示 2023-04-29 04:05:13 +08:00
binary-husky
920dccd076 修正提示 2023-04-29 04:03:06 +08:00
binary-husky
8fd21feb75 修改说明 2023-04-29 03:45:48 +08:00
binary-husky
c960b34fac 增加了对Azure密钥的识别 2023-04-29 03:22:31 +08:00
binary-husky
9ad00c78ba 临时修复超链接显示为公式的问题 2023-04-29 03:02:19 +08:00
binary-husky
4c3eeee00d Update README.md 2023-04-29 02:21:06 +08:00
binary-husky
a6393d4d05 Update README.md 2023-04-29 02:19:24 +08:00
binary-husky
92f3c078b5 让保存的html对话文件能够显示代码高亮 2023-04-29 02:04:08 +08:00
binary-husky
c53320182a 修复newbing引用样式 2023-04-29 01:51:11 +08:00
binary-husky
1788cb4a89 3.32 2023-04-29 00:50:19 +08:00
binary-husky
6a268e17cd 修复公式重复显示的bug 2023-04-29 00:48:48 +08:00
binary-husky
dbd8a80970 Merge branch 'master' of github.com:binary-husky/chatgpt_academic 2023-04-29 00:00:32 +08:00
binary-husky
6c17f3e9c8 添加历史存档读取的功能 2023-04-29 00:00:26 +08:00
binary-husky
730940b60d 修正多GPU选择的说明 2023-04-28 12:18:12 +08:00
binary-husky
71ba23b24a Update README.md 2023-04-28 11:18:54 +08:00
binary-husky
c12ac066b6 Update README.md 2023-04-28 11:18:02 +08:00
binary-husky
b6119ed827 Update README.md 2023-04-28 11:04:08 +08:00
Your Name
a219512045 fix auto upgrade issue 2023-04-27 21:26:01 +08:00
Your Name
dfa31a8c16 3.31 2023-04-27 21:15:22 +08:00
Your Name
984c7e9e12 修正自动更新路径 2023-04-27 21:11:15 +08:00
binary-husky
86b654d6be Update README.md 2023-04-27 20:30:03 +08:00
binary-husky
8c16cda3e8 Update README.md 2023-04-27 20:07:33 +08:00
binary-husky
c295bb4f04 ChatGLM加线程锁提高并发稳定性 2023-04-27 20:01:36 +08:00
binary-husky
8720f79310 Merge branch 'master' of github.com:binary-husky/chatgpt_academic 2023-04-27 19:59:01 +08:00
binary-husky
24bb174b63 Update README.md 2023-04-27 11:35:53 +08:00
binary-husky
bb788b9259 Update README.md 2023-04-27 11:33:37 +08:00
binary-husky
69540d07c5 修改dockerfile 2023-04-27 11:22:02 +08:00
binary-husky
34b767d1fd thread lock in chatglm 2023-04-27 11:17:19 +08:00
binary-husky
abd81cc215 Merge branch 'master' of github.com:binary-husky/chatgpt_academic 2023-04-27 10:58:51 +08:00
binary-husky
1eb0174dff 新增DARK_MODE选项,可选择默认颜色模式 2023-04-27 10:58:45 +08:00
binary-husky
c23db4b4f9 Update README.md 2023-04-26 23:04:58 +08:00
33 changed files with 6042 additions and 61 deletions

1
.gitignore vendored
View File

@@ -146,3 +146,4 @@ debug*
private*
crazy_functions/test_project/pdf_and_word
crazy_functions/test_samples
request_llm/jittorllms

View File

@@ -1,15 +1,15 @@
> **Note**
>
> 本项目依赖的Gradio组件的新版pip包(Gradio 3.26~3.27)有严重bug。所以请在安装时严格选择requirements.txt中**指定的版本**。
> 安装依赖时,请严格选择requirements.txt中**指定的版本**。
>
> `pip install -r requirements.txt -i https://mirrors.aliyun.com/pypi/simple/`
>
# <img src="docs/logo.png" width="40" > ChatGPT 学术优化
# <img src="docs/logo.png" width="40" > GPT 学术优化 (GPT Academic)
**如果喜欢这个项目请给它一个Star如果你发明了更好用的快捷键或函数插件欢迎发pull requests**
If you like this project, please give it a Star. If you've come up with more useful academic shortcuts or functional plugins, feel free to open an issue or pull request. We also have a README in [English|](docs/README_EN.md)[日本語|](docs/README_JP.md)[Русский|](docs/README_RS.md)[Français](docs/README_FR.md) translated by this project itself.
If you like this project, please give it a Star. If you've come up with more useful academic shortcuts or functional plugins, feel free to open an issue or pull request. We also have a README in [English|](docs/README_EN.md)[日本語|](docs/README_JP.md)[한국어|](https://github.com/mldljyh/ko_gpt_academic)[Русский|](docs/README_RS.md)[Français](docs/README_FR.md) translated by this project itself.
> **Note**
>
@@ -17,7 +17,7 @@ If you like this project, please give it a Star. If you've come up with more use
>
> 2.本项目中每个文件的功能都在自译解[`self_analysis.md`](https://github.com/binary-husky/chatgpt_academic/wiki/chatgpt-academic%E9%A1%B9%E7%9B%AE%E8%87%AA%E8%AF%91%E8%A7%A3%E6%8A%A5%E5%91%8A)详细说明。随着版本的迭代您也可以随时自行点击相关函数插件调用GPT重新生成项目的自我解析报告。常见问题汇总在[`wiki`](https://github.com/binary-husky/chatgpt_academic/wiki/%E5%B8%B8%E8%A7%81%E9%97%AE%E9%A2%98)当中。
>
> 3.已支持OpenAI和API2D的api-key共存可在配置文件中填写如`API_KEY="openai-key1,openai-key2,api2d-key3"`。需要临时更换`API_KEY`时,在输入区输入临时的`API_KEY`然后回车键提交后即可生效。
> 3.本项目兼容并鼓励尝试国产大语言模型chatglm和RWKV, 盘古等等。已支持OpenAI和API2D的api-key共存可在配置文件中填写如`API_KEY="openai-key1,openai-key2,api2d-key3"`。需要临时更换`API_KEY`时,在输入区输入临时的`API_KEY`然后回车键提交后即可生效。
<div align="center">
@@ -30,7 +30,7 @@ If you like this project, please give it a Star. If you've come up with more use
模块化设计 | 支持自定义强大的[函数插件](https://github.com/binary-husky/chatgpt_academic/tree/master/crazy_functions),插件支持[热更新](https://github.com/binary-husky/chatgpt_academic/wiki/%E5%87%BD%E6%95%B0%E6%8F%92%E4%BB%B6%E6%8C%87%E5%8D%97)
[自我程序剖析](https://www.bilibili.com/video/BV1cj411A7VW) | [函数插件] [一键读懂](https://github.com/binary-husky/chatgpt_academic/wiki/chatgpt-academic%E9%A1%B9%E7%9B%AE%E8%87%AA%E8%AF%91%E8%A7%A3%E6%8A%A5%E5%91%8A)本项目的源代码
[程序剖析](https://www.bilibili.com/video/BV1cj411A7VW) | [函数插件] 一键可以剖析其他Python/C/C++/Java/Lua/...项目树
读论文、翻译论文 | [函数插件] 一键解读latex/pdf论文全文并生成摘要
读论文、[翻译](https://www.bilibili.com/video/BV1KT411x7Wn)论文 | [函数插件] 一键解读latex/pdf论文全文并生成摘要
Latex全文[翻译](https://www.bilibili.com/video/BV1nk4y1Y7Js/)、[润色](https://www.bilibili.com/video/BV1FT411H7c5/) | [函数插件] 一键翻译或润色latex论文
批量注释生成 | [函数插件] 一键批量生成函数注释
Markdown[中英互译](https://www.bilibili.com/video/BV1yo4y157jV/) | [函数插件] 看到上面5种语言的[README](https://github.com/binary-husky/chatgpt_academic/blob/master/docs/README_EN.md)了吗?
@@ -38,12 +38,12 @@ chat分析报告生成 | [函数插件] 运行后自动生成总结汇报
[PDF论文全文翻译功能](https://www.bilibili.com/video/BV1KT411x7Wn) | [函数插件] PDF论文提取题目&摘要+翻译全文(多线程)
[Arxiv小助手](https://www.bilibili.com/video/BV1LM4y1279X) | [函数插件] 输入arxiv文章url即可一键翻译摘要+下载PDF
[谷歌学术统合小助手](https://www.bilibili.com/video/BV19L411U7ia) | [函数插件] 给定任意谷歌学术搜索页面URL让gpt帮你[写relatedworks](https://www.bilibili.com/video/BV1GP411U7Az/)
互联网信息聚合+GPT | [函数插件] 一键让ChatGPT先Google搜索,再回答问题,信息永不过时
互联网信息聚合+GPT | [函数插件] 一键[让GPT先从互联网获取信息](https://www.bilibili.com/video/BV1om4y127ck),再回答问题,信息永不过时
公式/图片/表格显示 | 可以同时显示公式的[tex形式和渲染形式](https://user-images.githubusercontent.com/96192199/230598842-1d7fcddd-815d-40ee-af60-baf488a199df.png),支持公式、代码高亮
多线程函数插件支持 | 支持多线调用chatgpt一键处理[海量文本](https://www.bilibili.com/video/BV1FT411H7c5/)或程序
启动暗色gradio[主题](https://github.com/binary-husky/chatgpt_academic/issues/173) | 在浏览器url后面添加```/?__dark-theme=true```可以切换dark主题
[多LLM模型](https://www.bilibili.com/video/BV1wT411p7yf)支持,[API2D](https://api2d.com/)接口支持 | 同时被GPT3.5、GPT4和[清华ChatGLM](https://github.com/THUDM/ChatGLM-6B)伺候的感觉一定会很不错吧?
更多LLM模型接入 | 新加入Newbing测试接口(新必应AI)
更多LLM模型接入,支持[huggingface部署](https://huggingface.co/spaces/qingxu98/gpt-academic) | 新加入Newbing测试接口(新必应AI)
…… | ……
</div>
@@ -92,14 +92,14 @@ cd chatgpt_academic
2. 配置API_KEY
在`config.py`中配置API KEY等[设置](https://github.com/binary-husky/gpt_academic/issues/1) 。
在`config.py`中配置API KEY等设置,[特殊网络环境设置](https://github.com/binary-husky/gpt_academic/issues/1) 。
P.S. 程序运行时会优先检查是否存在名为`config_private.py`的私密配置文件,并用其中的配置覆盖`config.py`的同名配置。因此,如果您能理解我们的配置读取逻辑,我们强烈建议您在`config.py`旁边创建一个名为`config_private.py`的新配置文件,并把`config.py`中的配置转移(复制)到`config_private.py`中。`config_private.py`不受git管控可以让您的隐私信息更加安全。
3. 安装依赖
```sh
# 选择I: 如熟悉python推荐
# 选择I: 如熟悉pythonpython版本3.9以上,越新越好)
python -m pip install -r requirements.txt
# 备注使用官方pip源或者阿里pip源其他pip源如一些大学的pip有可能出问题临时换源方法python -m pip install -r requirements.txt -i https://mirrors.aliyun.com/pypi/simple/
@@ -112,6 +112,10 @@ python -m pip install -r requirements.txt
如果需要支持清华ChatGLM后端需要额外安装更多依赖前提条件熟悉python + 电脑配置够强):
```sh
python -m pip install -r request_llm/requirements_chatglm.txt
# 备注:如果遇到"Call ChatGLM fail 不能正常加载ChatGLM的参数" 错误,参考如下:
# 1以上默认安装的为torch+cpu版使用cuda需要卸载torch重新安装torch+cuda
# 2如因本机配置不够无法加载模型可以修改request_llm/bridge_chatglm.py中的模型精度, 将 AutoTokenizer.from_pretrained("THUDM/chatglm-6b", trust_remote_code=True) 都修改为 AutoTokenizer.from_pretrained("THUDM/chatglm-6b-int4", trust_remote_code=True)
```
4. 运行
@@ -156,17 +160,30 @@ docker run --rm -it --net=host --gpus=all gpt-academic
docker run --rm -it --net=host --gpus=all gpt-academic bash
```
## 安装-方法3其他部署方式需要云服务器知识与经验
3. ChatGPT + LLAMA + 盘古 + RWKV需要精通Docker
``` sh
1. 修改docker-compose.yml删除方案一和方案二保留方案三基于jittor
2. 修改docker-compose.yml中方案三的配置参考其中注释即可
3. 终端运行 docker-compose up
```
1. 远程云服务器部署
## 安装-方法3其他部署姿势
1. 如何使用反代URL/微软云AzureAPI
按照`config.py`中的说明配置API_URL_REDIRECT即可。
2. 远程云服务器部署(需要云服务器知识与经验)
请访问[部署wiki-1](https://github.com/binary-husky/chatgpt_academic/wiki/%E4%BA%91%E6%9C%8D%E5%8A%A1%E5%99%A8%E8%BF%9C%E7%A8%8B%E9%83%A8%E7%BD%B2%E6%8C%87%E5%8D%97)
2. 使用WSL2Windows Subsystem for Linux 子系统)
3. 使用WSL2Windows Subsystem for Linux 子系统)
请访问[部署wiki-2](https://github.com/binary-husky/chatgpt_academic/wiki/%E4%BD%BF%E7%94%A8WSL2%EF%BC%88Windows-Subsystem-for-Linux-%E5%AD%90%E7%B3%BB%E7%BB%9F%EF%BC%89%E9%83%A8%E7%BD%B2)
3. 如何在二级网址(如`http://localhost/subpath`)下运行
4. 如何在二级网址(如`http://localhost/subpath`)下运行
请访问[FastAPI运行说明](docs/WithFastapi.md)
5. 使用docker-compose运行
请阅读docker-compose.yml后按照其中的提示操作即可
---
## 自定义新的便捷按钮 / 自定义函数插件
@@ -193,9 +210,48 @@ docker run --rm -it --net=host --gpus=all gpt-academic bash
本项目的插件编写、调试难度很低只要您具备一定的python基础知识就可以仿照我们提供的模板实现自己的插件功能。
详情请参考[函数插件指南](https://github.com/binary-husky/chatgpt_academic/wiki/%E5%87%BD%E6%95%B0%E6%8F%92%E4%BB%B6%E6%8C%87%E5%8D%97)。
---
## 其他功能说明
1. 对话保存功能。在函数插件区调用 `保存当前的对话` 即可将当前对话保存为可读+可复原的html文件如图
<div align="center">
<img src="https://user-images.githubusercontent.com/96192199/235222390-24a9acc0-680f-49f5-bc81-2f3161f1e049.png" width="500" >
</div>
在函数插件区(下拉菜单)调用 `载入对话历史存档` ,即可还原之前的会话。
2. 生成报告。大部分插件都会在执行结束后,生成工作报告
<div align="center">
<img src="https://user-images.githubusercontent.com/96192199/227503770-fe29ce2c-53fd-47b0-b0ff-93805f0c2ff4.png" height="300" >
<img src="https://user-images.githubusercontent.com/96192199/227504617-7a497bb3-0a2a-4b50-9a8a-95ae60ea7afd.png" height="300" >
<img src="https://user-images.githubusercontent.com/96192199/227504005-efeaefe0-b687-49d0-bf95-2d7b7e66c348.png" height="300" >
</div>
3. 模块化功能设计,简单的接口却能支持强大的功能
<div align="center">
<img src="https://user-images.githubusercontent.com/96192199/229288270-093643c1-0018-487a-81e6-1d7809b6e90f.png" height="400" >
<img src="https://user-images.githubusercontent.com/96192199/227504931-19955f78-45cd-4d1c-adac-e71e50957915.png" height="400" >
</div>
4. 这是一个能够“自我译解”的开源项目
<div align="center">
<img src="https://user-images.githubusercontent.com/96192199/226936850-c77d7183-0749-4c1c-9875-fd4891842d0c.png" width="500" >
</div>
5. 译解其他开源项目,不在话下
<div align="center">
<img src="https://user-images.githubusercontent.com/96192199/226935232-6b6a73ce-8900-4aee-93f9-733c7e6fef53.png" width="500" >
</div>
<div align="center">
<img src="https://user-images.githubusercontent.com/96192199/226969067-968a27c1-1b9c-486b-8b81-ab2de8d3f88a.png" width="500" >
</div>
## 版本:
- version 3.5(Todo): 使用自然语言调用本项目的所有函数插件(高优先级)
- version 3.4(Todo): 完善chatglm本地大模型的多线支持
- version 3.3: +互联网信息综合功能
- version 3.2: 函数插件支持更多参数接口 (保存对话功能, 解读任意语言代码+同时询问任意的LLM组合)
- version 3.1: 支持同时问询多个gpt模型支持api2d支持多个apikey负载均衡
- version 3.0: 对chatglm和其他小型llm的支持
@@ -208,6 +264,8 @@ docker run --rm -it --net=host --gpus=all gpt-academic bash
- version 2.0: 引入模块化函数插件
- version 1.0: 基础功能
gpt_academic开发者QQ群734063350
## 参考与学习

View File

@@ -56,22 +56,24 @@ def patch_and_restart(path):
"""
一键更新协议:覆盖和重启
"""
import distutils
from distutils import dir_util
import shutil
import os
import sys
import time
import glob
from colorful import print亮黄, print亮绿, print亮红
# if not using config_private, move origin config.py as config_private.py
if not os.path.exists('config_private.py'):
print亮黄('由于您没有设置config_private.py私密配置现将您的现有配置移动至config_private.py以防止配置丢失',
'另外您可以随时在history子文件夹下找回旧版的程序。')
shutil.copyfile('config.py', 'config_private.py')
distutils.dir_util.copy_tree(path+'/chatgpt_academic-master', './')
import subprocess
path_new_version = glob.glob(path + '/*-master')[0]
dir_util.copy_tree(path_new_version, './')
print亮绿('代码已经更新即将更新pip包依赖……')
for i in reversed(range(5)): time.sleep(1); print(i)
try:
import subprocess
subprocess.check_call([sys.executable, '-m', 'pip', 'install', '-r', 'requirements.txt'])
except:
print亮红('pip包依赖安装出现问题需要手动安装新增的依赖库 `python -m pip install -r requirements.txt`,然后在用常规的`python main.py`的方式启动。')

View File

@@ -10,11 +10,11 @@ if USE_PROXY:
# [地址] 懂的都懂不懂就填localhost或者127.0.0.1肯定错不了localhost意思是代理软件安装在本机上
# [端口] 在代理软件的设置里找。虽然不同的代理软件界面不一样,但端口号都应该在最显眼的位置上
# 代理网络的地址,打开你的科学上网软件查看代理的协议(socks5/http)、地址(localhost)和端口(11284)
# 代理网络的地址,打开你的*学*网软件查看代理的协议(socks5/http)、地址(localhost)和端口(11284)
proxies = {
# [协议]:// [地址] :[端口]
"http": "socks5h://localhost:11284",
"https": "socks5h://localhost:11284",
"http": "socks5h://localhost:11284", # 再例如 "http": "http://127.0.0.1:7890",
"https": "socks5h://localhost:11284", # 再例如 "https": "http://127.0.0.1:7890",
}
else:
proxies = None
@@ -33,6 +33,7 @@ CODE_HIGHLIGHT = True
# 窗口布局
LAYOUT = "LEFT-RIGHT" # "LEFT-RIGHT"(左右布局) # "TOP-DOWN"(上下布局)
DARK_MODE = True # "LEFT-RIGHT"(左右布局) # "TOP-DOWN"(上下布局)
# 发送请求到OpenAI后等待多久判定为超时
TIMEOUT_SECONDS = 30
@@ -53,12 +54,17 @@ LOCAL_MODEL_DEVICE = "cpu" # 可选 "cuda"
# 设置gradio的并行线程数不需要修改
CONCURRENT_COUNT = 100
# 加一个看板娘装饰
ADD_WAIFU = False
# 设置用户名和密码不需要修改相关功能不稳定与gradio版本和网络都相关如果本地使用不建议加这个
# [("username", "password"), ("username2", "password2"), ...]
AUTHENTICATION = []
# 重新URL重新定向实现更换API_URL的作用常规情况下不要修改!!
# 高危设置通过修改此设置您将把您的API-KEY和对话隐私完全暴露给您设定的中间人
# 格式 {"https://api.openai.com/v1/chat/completions": "在这里填写重定向的api.openai.com的URL"}
# 例如 API_URL_REDIRECT = {"https://api.openai.com/v1/chat/completions": "https://ai.open.com/api/conversation"}
API_URL_REDIRECT = {}
# 如果需要在二级路径下运行(常规情况下,不要修改!!需要配合修改main.py才能生效!

View File

@@ -11,7 +11,7 @@ def get_crazy_functions():
from crazy_functions.解析项目源代码 import 解析一个C项目
from crazy_functions.解析项目源代码 import 解析一个Golang项目
from crazy_functions.解析项目源代码 import 解析一个Java项目
from crazy_functions.解析项目源代码 import 解析一个Rect项目
from crazy_functions.解析项目源代码 import 解析一个前端项目
from crazy_functions.高级功能函数模板 import 高阶功能模板函数
from crazy_functions.代码重写为全英文_多线程 import 全项目切换英文
from crazy_functions.Latex全文润色 import Latex英文润色
@@ -21,16 +21,23 @@ def get_crazy_functions():
from crazy_functions.总结word文档 import 总结word文档
from crazy_functions.解析JupyterNotebook import 解析ipynb文件
from crazy_functions.对话历史存档 import 对话历史存档
from crazy_functions.对话历史存档 import 载入对话历史存档
from crazy_functions.对话历史存档 import 删除所有本地对话历史记录
from crazy_functions.批量Markdown翻译 import Markdown英译中
function_plugins = {
"解析整个Python项目": {
"Color": "stop", # 按钮颜色
"Function": HotReload(解析一个Python项目)
},
"保存当前的对话": {
"载入对话历史存档(先上传存档或输入路径)": {
"Color": "stop",
"AsButton":False,
"Function": HotReload(对话历史存档)
"Function": HotReload(载入对话历史存档)
},
"删除所有本地对话历史记录(请谨慎操作)": {
"AsButton":False,
"Function": HotReload(删除所有本地对话历史记录)
},
"[测试功能] 解析Jupyter Notebook文件": {
"Color": "stop",
@@ -63,10 +70,10 @@ def get_crazy_functions():
"AsButton": False, # 加入下拉菜单中
"Function": HotReload(解析一个Java项目)
},
"解析整个React项目": {
"解析整个前端项目js,ts,css等": {
"Color": "stop", # 按钮颜色
"AsButton": False, # 加入下拉菜单中
"Function": HotReload(解析一个Rect项目)
"Function": HotReload(解析一个前端项目)
},
"解析整个Lua项目": {
"Color": "stop", # 按钮颜色
@@ -92,15 +99,19 @@ def get_crazy_functions():
"AsButton": False, # 加入下拉菜单中
"Function": HotReload(批量生成函数注释)
},
"保存当前的对话": {
"Function": HotReload(对话历史存档)
},
"[多线程Demo] 解析此项目本身(源码自译解)": {
"AsButton": False, # 加入下拉菜单中
"Function": HotReload(解析项目本身)
},
"[多线程demo] 把本项目源代码切换成全英文": {
"[老旧的Demo] 把本项目源代码切换成全英文": {
# HotReload 的意思是热更新,修改函数插件代码后,不需要重启程序,代码直接生效
"AsButton": False, # 加入下拉菜单中
"Function": HotReload(全项目切换英文)
},
"[函数插件模板Demo] 历史上的今天": {
"[插件demo] 历史上的今天": {
# HotReload 的意思是热更新,修改函数插件代码后,不需要重启程序,代码直接生效
"Function": HotReload(高阶功能模板函数)
},
@@ -163,19 +174,19 @@ def get_crazy_functions():
"AsButton": False, # 加入下拉菜单中
"Function": HotReload(Latex中文润色)
},
"[测试功能] Latex项目全文中译英输入路径或上传压缩包": {
"Latex项目全文中译英输入路径或上传压缩包": {
# HotReload 的意思是热更新,修改函数插件代码后,不需要重启程序,代码直接生效
"Color": "stop",
"AsButton": False, # 加入下拉菜单中
"Function": HotReload(Latex中译英)
},
"[测试功能] Latex项目全文英译中输入路径或上传压缩包": {
"Latex项目全文英译中输入路径或上传压缩包": {
# HotReload 的意思是热更新,修改函数插件代码后,不需要重启程序,代码直接生效
"Color": "stop",
"AsButton": False, # 加入下拉菜单中
"Function": HotReload(Latex英译中)
},
"[测试功能] 批量Markdown中译英输入路径或上传压缩包": {
"批量Markdown中译英输入路径或上传压缩包": {
# HotReload 的意思是热更新,修改函数插件代码后,不需要重启程序,代码直接生效
"Color": "stop",
"AsButton": False, # 加入下拉菜单中

View File

@@ -563,3 +563,46 @@ def read_and_clean_pdf_text(fp):
# print亮绿('***************************')
return meta_txt, page_one_meta
def get_files_from_everything(txt, type): # type='.md'
"""
这个函数是用来获取指定目录下所有指定类型(如.md的文件并且对于网络上的文件也可以获取它。
下面是对每个参数和返回值的说明:
参数
- txt: 路径或网址,表示要搜索的文件或者文件夹路径或网络上的文件。
- type: 字符串,表示要搜索的文件类型。默认是.md。
返回值
- success: 布尔值,表示函数是否成功执行。
- file_manifest: 文件路径列表,里面包含以指定类型为后缀名的所有文件的绝对路径。
- project_folder: 字符串,表示文件所在的文件夹路径。如果是网络上的文件,就是临时文件夹的路径。
该函数详细注释已添加,请确认是否满足您的需要。
"""
import glob, os
success = True
if txt.startswith('http'):
# 网络的远程文件
import requests
from toolbox import get_conf
proxies, = get_conf('proxies')
r = requests.get(txt, proxies=proxies)
with open('./gpt_log/temp'+type, 'wb+') as f: f.write(r.content)
project_folder = './gpt_log/'
file_manifest = ['./gpt_log/temp'+type]
elif txt.endswith(type):
# 直接给定文件
file_manifest = [txt]
project_folder = os.path.dirname(txt)
elif os.path.exists(txt):
# 本地路径,递归搜索
project_folder = txt
file_manifest = [f for f in glob.glob(f'{project_folder}/**/*'+type, recursive=True)]
if len(file_manifest) == 0:
success = False
else:
project_folder = None
file_manifest = []
success = False
return success, file_manifest, project_folder

View File

@@ -1,7 +1,8 @@
from toolbox import CatchException, update_ui
from .crazy_utils import request_gpt_model_in_new_thread_with_ui_alive
import re
def write_chat_to_file(chatbot, file_name=None):
def write_chat_to_file(chatbot, history=None, file_name=None):
"""
将对话记录history以Markdown格式写入文件中。如果没有指定文件名则使用当前时间生成文件名。
"""
@@ -11,20 +12,62 @@ def write_chat_to_file(chatbot, file_name=None):
file_name = 'chatGPT对话历史' + time.strftime("%Y-%m-%d-%H-%M-%S", time.localtime()) + '.html'
os.makedirs('./gpt_log/', exist_ok=True)
with open(f'./gpt_log/{file_name}', 'w', encoding='utf8') as f:
from theme import advanced_css
f.write(f'<!DOCTYPE html><head><meta charset="utf-8"><title>对话历史</title><style>{advanced_css}</style></head>')
for i, contents in enumerate(chatbot):
for content in contents:
for j, content in enumerate(contents):
try: # 这个bug没找到触发条件暂时先这样顶一下
if type(content) != str: content = str(content)
except:
continue
f.write(content)
f.write('\n\n')
if j == 0:
f.write('<hr style="border-top: dotted 3px #ccc;">')
f.write('<hr color="red"> \n\n')
f.write('<hr color="blue"> \n\n raw chat context:\n')
f.write('<code>')
for h in history:
f.write("\n>>>" + h)
f.write('</code>')
res = '对话历史写入:' + os.path.abspath(f'./gpt_log/{file_name}')
print(res)
return res
def gen_file_preview(file_name):
try:
with open(file_name, 'r', encoding='utf8') as f:
file_content = f.read()
# pattern to match the text between <head> and </head>
pattern = re.compile(r'<head>.*?</head>', flags=re.DOTALL)
file_content = re.sub(pattern, '', file_content)
html, history = file_content.split('<hr color="blue"> \n\n raw chat context:\n')
history = history.strip('<code>')
history = history.strip('</code>')
history = history.split("\n>>>")
return list(filter(lambda x:x!="", history))[0][:100]
except:
return ""
def read_file_to_chat(chatbot, history, file_name):
with open(file_name, 'r', encoding='utf8') as f:
file_content = f.read()
# pattern to match the text between <head> and </head>
pattern = re.compile(r'<head>.*?</head>', flags=re.DOTALL)
file_content = re.sub(pattern, '', file_content)
html, history = file_content.split('<hr color="blue"> \n\n raw chat context:\n')
history = history.strip('<code>')
history = history.strip('</code>')
history = history.split("\n>>>")
history = list(filter(lambda x:x!="", history))
html = html.split('<hr color="red"> \n\n')
html = list(filter(lambda x:x!="", html))
chatbot.clear()
for i, h in enumerate(html):
i_say, gpt_say = h.split('<hr style="border-top: dotted 3px #ccc;">')
chatbot.append([i_say, gpt_say])
chatbot.append([f"存档文件详情?", f"[Local Message] 载入对话{len(html)}条,上下文{len(history)}条。"])
return chatbot, history
@CatchException
def 对话历史存档(txt, llm_kwargs, plugin_kwargs, chatbot, history, system_prompt, web_port):
"""
@@ -37,6 +80,64 @@ def 对话历史存档(txt, llm_kwargs, plugin_kwargs, chatbot, history, system_
web_port 当前软件运行的端口号
"""
chatbot.append(("保存当前对话", f"[Local Message] {write_chat_to_file(chatbot)}"))
chatbot.append(("保存当前对话",
f"[Local Message] {write_chat_to_file(chatbot, history)},您可以调用“载入对话历史存档”还原当下的对话。\n警告!被保存的对话历史可以被使用该系统的任何人查阅。"))
yield from update_ui(chatbot=chatbot, history=history) # 刷新界面 # 由于请求gpt需要一段时间我们先及时地做一次界面更新
def hide_cwd(str):
import os
current_path = os.getcwd()
replace_path = "."
return str.replace(current_path, replace_path)
@CatchException
def 载入对话历史存档(txt, llm_kwargs, plugin_kwargs, chatbot, history, system_prompt, web_port):
"""
txt 输入栏用户输入的文本,例如需要翻译的一段话,再例如一个包含了待处理文件的路径
llm_kwargs gpt模型参数如温度和top_p等一般原样传递下去就行
plugin_kwargs 插件模型的参数,暂时没有用武之地
chatbot 聊天显示框的句柄,用于显示给用户
history 聊天历史,前情提要
system_prompt 给gpt的静默提醒
web_port 当前软件运行的端口号
"""
from .crazy_utils import get_files_from_everything
success, file_manifest, _ = get_files_from_everything(txt, type='.html')
if not success:
if txt == "": txt = '空空如也的输入栏'
import glob
local_history = "<br/>".join(["`"+hide_cwd(f)+f" ({gen_file_preview(f)})"+"`" for f in glob.glob(f'gpt_log/**/chatGPT对话历史*.html', recursive=True)])
chatbot.append([f"正在查找对话历史文件html格式: {txt}", f"找不到任何html文件: {txt}。但本地存储了以下历史文件,您可以将任意一个文件路径粘贴到输入区,然后重试:<br/>{local_history}"])
yield from update_ui(chatbot=chatbot, history=history) # 刷新界面
return
try:
chatbot, history = read_file_to_chat(chatbot, history, file_manifest[0])
yield from update_ui(chatbot=chatbot, history=history) # 刷新界面
except:
chatbot.append([f"载入对话历史文件", f"对话历史文件损坏!"])
yield from update_ui(chatbot=chatbot, history=history) # 刷新界面
return
@CatchException
def 删除所有本地对话历史记录(txt, llm_kwargs, plugin_kwargs, chatbot, history, system_prompt, web_port):
"""
txt 输入栏用户输入的文本,例如需要翻译的一段话,再例如一个包含了待处理文件的路径
llm_kwargs gpt模型参数如温度和top_p等一般原样传递下去就行
plugin_kwargs 插件模型的参数,暂时没有用武之地
chatbot 聊天显示框的句柄,用于显示给用户
history 聊天历史,前情提要
system_prompt 给gpt的静默提醒
web_port 当前软件运行的端口号
"""
import glob, os
local_history = "<br/>".join(["`"+hide_cwd(f)+"`" for f in glob.glob(f'gpt_log/**/chatGPT对话历史*.html', recursive=True)])
for f in glob.glob(f'gpt_log/**/chatGPT对话历史*.html', recursive=True):
os.remove(f)
chatbot.append([f"删除所有历史对话文件", f"已删除<br/>{local_history}"])
yield from update_ui(chatbot=chatbot, history=history) # 刷新界面
return

View File

@@ -183,7 +183,7 @@ def 解析一个Java项目(txt, llm_kwargs, plugin_kwargs, chatbot, history, sys
@CatchException
def 解析一个Rect项目(txt, llm_kwargs, plugin_kwargs, chatbot, history, system_prompt, web_port):
def 解析一个前端项目(txt, llm_kwargs, plugin_kwargs, chatbot, history, system_prompt, web_port):
history = [] # 清空历史,以免输入溢出
import glob, os
if os.path.exists(txt):
@@ -197,9 +197,15 @@ def 解析一个Rect项目(txt, llm_kwargs, plugin_kwargs, chatbot, history, sys
[f for f in glob.glob(f'{project_folder}/**/*.tsx', recursive=True)] + \
[f for f in glob.glob(f'{project_folder}/**/*.json', recursive=True)] + \
[f for f in glob.glob(f'{project_folder}/**/*.js', recursive=True)] + \
[f for f in glob.glob(f'{project_folder}/**/*.vue', recursive=True)] + \
[f for f in glob.glob(f'{project_folder}/**/*.less', recursive=True)] + \
[f for f in glob.glob(f'{project_folder}/**/*.sass', recursive=True)] + \
[f for f in glob.glob(f'{project_folder}/**/*.wxml', recursive=True)] + \
[f for f in glob.glob(f'{project_folder}/**/*.wxss', recursive=True)] + \
[f for f in glob.glob(f'{project_folder}/**/*.css', recursive=True)] + \
[f for f in glob.glob(f'{project_folder}/**/*.jsx', recursive=True)]
if len(file_manifest) == 0:
report_execption(chatbot, history, a=f"解析项目: {txt}", b=f"找不到任何Rect文件: {txt}")
report_execption(chatbot, history, a=f"解析项目: {txt}", b=f"找不到任何前端相关文件: {txt}")
yield from update_ui(chatbot=chatbot, history=history) # 刷新界面
return
yield from 解析源代码新(file_manifest, project_folder, llm_kwargs, plugin_kwargs, chatbot, history, system_prompt)

122
docker-compose.yml Normal file
View File

@@ -0,0 +1,122 @@
【请在修改完参数后删除此行】请在以下方案中选择一种然后删除其他的方案最后docker-compose up运行
## ===================================================
## 【方案一】 如果不需要运行本地模型仅chatgpt类远程服务
## ===================================================
version: '3'
services:
gpt_academic_nolocalllms:
image: fuqingxu/gpt_academic:no-local-llms
environment:
# 请查阅 `config.py` 以查看所有的配置信息
API_KEY: ' sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx,fkxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx '
USE_PROXY: ' True '
proxies: ' { "http": "socks5h://localhost:10880", "https": "socks5h://localhost:10880", } '
LLM_MODEL: ' gpt-3.5-turbo '
AVAIL_LLM_MODELS: ' ["gpt-3.5-turbo", "api2d-gpt-4"] '
DEFAULT_WORKER_NUM: ' 10 '
WEB_PORT: ' 22303 '
ADD_WAIFU: ' True '
AUTHENTICATION: ' [("username", "passwd"), ("username2", "passwd2")] '
# 与宿主的网络融合
network_mode: "host"
# 不使用代理网络拉取最新代码
command: >
bash -c " echo '[gpt-academic] 正在从github拉取最新代码...' &&
git checkout master --force &&
git remote set-url origin https://github.com/binary-husky/chatgpt_academic.git &&
git pull &&
python3 -u main.py"
### ===================================================
### 【方案二】 如果需要运行ChatGLM本地模型
### ===================================================
version: '3'
services:
gpt_academic_with_chatglm:
image: fuqingxu/gpt_academic:chatgpt-chatglm-newbing # [option 2] 如果需要运行ChatGLM本地模型
environment:
# 请查阅 `config.py` 以查看所有的配置信息
API_KEY: ' sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx,fkxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx '
USE_PROXY: ' True '
proxies: ' { "http": "socks5h://localhost:10880", "https": "socks5h://localhost:10880", } '
LLM_MODEL: ' gpt-3.5-turbo '
AVAIL_LLM_MODELS: ' ["gpt-3.5-turbo", "api2d-gpt-4", "chatglm"] '
LOCAL_MODEL_DEVICE: ' cuda '
DEFAULT_WORKER_NUM: ' 10 '
WEB_PORT: ' 12303 '
ADD_WAIFU: ' True '
AUTHENTICATION: ' [("username", "passwd"), ("username2", "passwd2")] '
# 显卡的使用nvidia0指第0个GPU
runtime: nvidia
devices:
- /dev/nvidia0:/dev/nvidia0
# 与宿主的网络融合
network_mode: "host"
# 使用代理网络拉取最新代码
# command: >
# bash -c " echo '[gpt-academic] 正在从github拉取最新代码...' &&
# truncate -s -1 /etc/proxychains.conf &&
# echo \"socks5 127.0.0.1 10880\" >> /etc/proxychains.conf &&
# proxychains git pull &&
# python3 -u main.py "
# 不使用代理网络拉取最新代码
command: >
bash -c " echo '[gpt-academic] 正在从github拉取最新代码...' &&
git pull &&
python3 -u main.py"
### ===================================================
### 【方案三】 如果需要运行ChatGPT + LLAMA + 盘古 + RWKV本地模型
### ===================================================
version: '3'
services:
gpt_academic_with_rwkv:
image: fuqingxu/gpt_academic:jittorllms # [option 2] 如果需要运行ChatGLM本地模型
environment:
# 请查阅 `config.py` 以查看所有的配置信息
API_KEY: ' sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx,fkxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx '
USE_PROXY: ' True '
proxies: ' { "http": "socks5h://localhost:10880", "https": "socks5h://localhost:10880", } '
LLM_MODEL: ' gpt-3.5-turbo '
AVAIL_LLM_MODELS: ' ["gpt-3.5-turbo", "api2d-gpt-4", "jittorllms_rwkv"] '
LOCAL_MODEL_DEVICE: ' cuda '
DEFAULT_WORKER_NUM: ' 10 '
WEB_PORT: ' 12305 '
ADD_WAIFU: ' True '
# AUTHENTICATION: ' [("username", "passwd"), ("username2", "passwd2")] '
# 显卡的使用nvidia0指第0个GPU
runtime: nvidia
devices:
- /dev/nvidia0:/dev/nvidia0
# 与宿主的网络融合
network_mode: "host"
# 使用代理网络拉取最新代码
# command: >
# bash -c " truncate -s -1 /etc/proxychains.conf &&
# echo \"socks5 127.0.0.1 10880\" >> /etc/proxychains.conf &&
# echo '[gpt-academic] 正在从github拉取最新代码...' &&
# proxychains git pull &&
# echo '[jittorllms] 正在从github拉取最新代码...' &&
# proxychains git --git-dir=request_llm/jittorllms/.git --work-tree=request_llm/jittorllms pull --force &&
# python3 -u main.py"
# 不使用代理网络拉取最新代码
command: >
bash -c " echo '[gpt-academic] 正在从github拉取最新代码...' &&
git pull &&
echo '[jittorllms] 正在从github拉取最新代码...' &&
git --git-dir=request_llm/jittorllms/.git --work-tree=request_llm/jittorllms pull --force &&
python3 -u main.py"

View File

@@ -1,6 +1,6 @@
# How to build | 如何构建: docker build -t gpt-academic --network=host -f Dockerfile+ChatGLM .
# How to run | 如何运行 (1) 直接运行选择0号GPU: docker run --rm -it --net=host --gpus="0" gpt-academic
# How to run | 如何运行 (2) 我想运行之前进容器做一些调整: docker run --rm -it --net=host --gpus="0" gpt-academic bash
# How to run | (1) 我想直接一键运行选择0号GPU: docker run --rm -it --net=host --gpus \"device=0\" gpt-academic
# How to run | (2) 我想运行之前进容器做一些调整选择1号GPU: docker run --rm -it --net=host --gpus \"device=1\" gpt-academic bash
# 从NVIDIA源从而支持显卡运损检查宿主的nvidia-smi中的cuda版本必须>=11.3
FROM nvidia/cuda:11.3.1-runtime-ubuntu20.04
@@ -14,6 +14,7 @@ RUN apt-get install -y git python python3 python-dev python3-dev --fix-missing
RUN $useProxyNetwork curl cip.cc
RUN sed -i '$ d' /etc/proxychains.conf
RUN sed -i '$ d' /etc/proxychains.conf
# 在这里填写主机的代理协议用于从github拉取代码
RUN echo "socks5 127.0.0.1 10880" >> /etc/proxychains.conf
ARG useProxyNetwork=proxychains
# # comment out above if you do not need proxy network | 如果不需要翻墙 - 从此行向上删除
@@ -21,14 +22,15 @@ ARG useProxyNetwork=proxychains
# use python3 as the system default python
RUN curl -sS https://bootstrap.pypa.io/get-pip.py | python3.8
# 下载pytorch
RUN $useProxyNetwork python3 -m pip install torch --extra-index-url https://download.pytorch.org/whl/cu113
# 下载分支
WORKDIR /gpt
RUN $useProxyNetwork git clone https://github.com/binary-husky/chatgpt_academic.git
WORKDIR /gpt/chatgpt_academic
RUN $useProxyNetwork python3 -m pip install -r requirements.txt
RUN $useProxyNetwork python3 -m pip install -r request_llm/requirements_chatglm.txt
RUN $useProxyNetwork python3 -m pip install torch --extra-index-url https://download.pytorch.org/whl/cu113
RUN $useProxyNetwork python3 -m pip install -r request_llm/requirements_newbing.txt
# 预热CHATGLM参数非必要 可选步骤)
RUN echo ' \n\
@@ -48,6 +50,7 @@ RUN python3 -c 'from check_proxy import warm_up_modules; warm_up_modules()'
# 可同时填写多个API-KEY支持openai的key和api2d的key共存用英文逗号分割例如API_KEY = "sk-openaikey1,fkxxxx-api2dkey2,........"
# LLM_MODEL 是选择初始的模型
# LOCAL_MODEL_DEVICE 是选择chatglm等本地模型运行的设备可选 cpu 和 cuda
# [说明: 以下内容与`config.py`一一对应请查阅config.py来完成一下配置的填写]
RUN echo ' \n\
API_KEY = "sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx,fkxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \n\
USE_PROXY = True \n\

View File

@@ -157,7 +157,7 @@
## [22/31] 请对下面的程序文件做一个概述: H:\chatgpt_academic_resolve\crazy_functions\解析项目源代码.py
这个程序文件实现了对一个源代码项目进行分析的功能其中函数`解析项目本身``解析一个Python项目``解析一个C项目的头文件``解析一个C项目``解析一个Java项目``解析一个Rect项目`分别用于解析不同类型的项目函数`解析源代码新`实现了对每一个源代码文件的分析并将分析结果汇总同时还实现了分组和迭代处理提高了效率最后函数`write_results_to_file`将所有分析结果写入文件中间还用到了`request_gpt_model_multi_threads_with_very_awesome_ui_and_high_efficiency``request_gpt_model_in_new_thread_with_ui_alive`来完成请求和响应并用`update_ui`实时更新界面
这个程序文件实现了对一个源代码项目进行分析的功能其中函数`解析项目本身``解析一个Python项目``解析一个C项目的头文件``解析一个C项目``解析一个Java项目``解析前端项目`分别用于解析不同类型的项目函数`解析源代码新`实现了对每一个源代码文件的分析并将分析结果汇总同时还实现了分组和迭代处理提高了效率最后函数`write_results_to_file`将所有分析结果写入文件中间还用到了`request_gpt_model_multi_threads_with_very_awesome_ui_and_high_efficiency``request_gpt_model_in_new_thread_with_ui_alive`来完成请求和响应并用`update_ui`实时更新界面
## [23/31] 请对下面的程序文件做一个概述: H:\chatgpt_academic_resolve\crazy_functions\询问多个大语言模型.py

View File

@@ -0,0 +1,130 @@
sample = """
[1]: https://baike.baidu.com/item/%E8%B4%A8%E8%83%BD%E6%96%B9%E7%A8%8B/1884527 "质能方程质能方程式_百度百科"
[2]: https://www.zhihu.com/question/348249281 "如何理解质能方程 Emc² - 知乎"
[3]: https://zhuanlan.zhihu.com/p/32597385 "质能方程的推导与理解 - 知乎 - 知乎专栏"
你好,这是必应。质能方程是描述质量与能量之间的当量关系的方程[^1^][1]。用tex格式质能方程可以写成$$E=mc^2$$,其中$E$是能量,$m$是质量,$c$是光速[^2^][2] [^3^][3]。
"""
import re
def preprocess_newbing_out(s):
pattern = r'\^(\d+)\^' # 匹配^数字^
pattern2 = r'\[(\d+)\]' # 匹配^数字^
sub = lambda m: '\['+m.group(1)+'\]' # 将匹配到的数字作为替换值
result = re.sub(pattern, sub, s) # 替换操作
if '[1]' in result:
result += '<br/><hr style="border-top: dotted 1px #44ac5c;"><br/><small>' + "<br/>".join([re.sub(pattern2, sub, r) for r in result.split('\n') if r.startswith('[')]) + '</small>'
return result
def close_up_code_segment_during_stream(gpt_reply):
"""
在gpt输出代码的中途输出了前面的```,但还没输出完后面的```),补上后面的```
Args:
gpt_reply (str): GPT模型返回的回复字符串。
Returns:
str: 返回一个新的字符串,将输出代码片段的“后面的```”补上。
"""
if '```' not in gpt_reply:
return gpt_reply
if gpt_reply.endswith('```'):
return gpt_reply
# 排除了以上两个情况,我们
segments = gpt_reply.split('```')
n_mark = len(segments) - 1
if n_mark % 2 == 1:
# print('输出代码片段中!')
return gpt_reply+'\n```'
else:
return gpt_reply
import markdown
from latex2mathml.converter import convert as tex2mathml
from functools import wraps, lru_cache
def markdown_convertion(txt):
"""
将Markdown格式的文本转换为HTML格式。如果包含数学公式则先将公式转换为HTML格式。
"""
pre = '<div class="markdown-body">'
suf = '</div>'
if txt.startswith(pre) and txt.endswith(suf):
# print('警告,输入了已经经过转化的字符串,二次转化可能出问题')
return txt # 已经被转化过,不需要再次转化
markdown_extension_configs = {
'mdx_math': {
'enable_dollar_delimiter': True,
'use_gitlab_delimiters': False,
},
}
find_equation_pattern = r'<script type="math/tex(?:.*?)>(.*?)</script>'
def tex2mathml_catch_exception(content, *args, **kwargs):
try:
content = tex2mathml(content, *args, **kwargs)
except:
content = content
return content
def replace_math_no_render(match):
content = match.group(1)
if 'mode=display' in match.group(0):
content = content.replace('\n', '</br>')
return f"<font color=\"#00FF00\">$$</font><font color=\"#FF00FF\">{content}</font><font color=\"#00FF00\">$$</font>"
else:
return f"<font color=\"#00FF00\">$</font><font color=\"#FF00FF\">{content}</font><font color=\"#00FF00\">$</font>"
def replace_math_render(match):
content = match.group(1)
if 'mode=display' in match.group(0):
if '\\begin{aligned}' in content:
content = content.replace('\\begin{aligned}', '\\begin{array}')
content = content.replace('\\end{aligned}', '\\end{array}')
content = content.replace('&', ' ')
content = tex2mathml_catch_exception(content, display="block")
return content
else:
return tex2mathml_catch_exception(content)
def markdown_bug_hunt(content):
"""
解决一个mdx_math的bug单$包裹begin命令时多余<script>
"""
content = content.replace('<script type="math/tex">\n<script type="math/tex; mode=display">', '<script type="math/tex; mode=display">')
content = content.replace('</script>\n</script>', '</script>')
return content
if ('$' in txt) and ('```' not in txt): # 有$标识的公式符号,且没有代码段```的标识
# convert everything to html format
split = markdown.markdown(text='---')
convert_stage_1 = markdown.markdown(text=txt, extensions=['mdx_math', 'fenced_code', 'tables', 'sane_lists'], extension_configs=markdown_extension_configs)
convert_stage_1 = markdown_bug_hunt(convert_stage_1)
# re.DOTALL: Make the '.' special character match any character at all, including a newline; without this flag, '.' will match anything except a newline. Corresponds to the inline flag (?s).
# 1. convert to easy-to-copy tex (do not render math)
convert_stage_2_1, n = re.subn(find_equation_pattern, replace_math_no_render, convert_stage_1, flags=re.DOTALL)
# 2. convert to rendered equation
convert_stage_2_2, n = re.subn(find_equation_pattern, replace_math_render, convert_stage_1, flags=re.DOTALL)
# cat them together
return pre + convert_stage_2_1 + f'{split}' + convert_stage_2_2 + suf
else:
return pre + markdown.markdown(txt, extensions=['fenced_code', 'codehilite', 'tables', 'sane_lists']) + suf
sample = preprocess_newbing_out(sample)
sample = close_up_code_segment_during_stream(sample)
sample = markdown_convertion(sample)
with open('tmp.html', 'w', encoding='utf8') as f:
f.write("""
<head>
<title>My Website</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
""")
f.write(sample)

View File

@@ -0,0 +1,23 @@
try {
$("<link>").attr({href: "file=docs/waifu_plugin/waifu.css", rel: "stylesheet", type: "text/css"}).appendTo('head');
$('body').append('<div class="waifu"><div class="waifu-tips"></div><canvas id="live2d" class="live2d"></canvas><div class="waifu-tool"><span class="fui-home"></span> <span class="fui-chat"></span> <span class="fui-eye"></span> <span class="fui-user"></span> <span class="fui-photo"></span> <span class="fui-info-circle"></span> <span class="fui-cross"></span></div></div>');
$.ajax({url: "file=docs/waifu_plugin/waifu-tips.js", dataType:"script", cache: true, success: function() {
$.ajax({url: "file=docs/waifu_plugin/live2d.js", dataType:"script", cache: true, success: function() {
/* 可直接修改部分参数 */
live2d_settings['hitokotoAPI'] = "hitokoto.cn"; // 一言 API
live2d_settings['modelId'] = 5; // 默认模型 ID
live2d_settings['modelTexturesId'] = 1; // 默认材质 ID
live2d_settings['modelStorage'] = false; // 不储存模型 ID
live2d_settings['waifuSize'] = '210x187';
live2d_settings['waifuTipsSize'] = '187x52';
live2d_settings['canSwitchModel'] = true;
live2d_settings['canSwitchTextures'] = true;
live2d_settings['canSwitchHitokoto'] = false;
live2d_settings['canTakeScreenshot'] = false;
live2d_settings['canTurnToHomePage'] = false;
live2d_settings['canTurnToAboutPage'] = false;
/* 在 initModel 前添加 */
initModel("file=docs/waifu_plugin/waifu-tips.json");
}});
}});
} catch(err) { console.log("[Error] JQuery is not defined.") }

Binary file not shown.

View File

@@ -0,0 +1,126 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
<svg xmlns="http://www.w3.org/2000/svg">
<metadata>
<json>
{
"fontFamily": "flat-ui-icons",
"majorVersion": 1,
"minorVersion": 1,
"fontURL": "http://designmodo.com/flat",
"designer": "Sergey Shmidt",
"designerURL": "http://designmodo.com",
"license": "Attribution-NonCommercial-NoDerivs 3.0 Unported",
"licenseURL": "http://creativecommons.org/licenses/by-nc-nd/3.0/",
"version": "Version 1.1",
"fontId": "flat-ui-icons",
"psName": "flat-ui-icons",
"subFamily": "Regular",
"fullName": "flat-ui-icons",
"description": "Generated by IcoMoon"
}
</json>
</metadata>
<defs>
<font id="flat-ui-icons" horiz-adv-x="1024">
<font-face units-per-em="1024" ascent="960" descent="-64" />
<missing-glyph horiz-adv-x="1024" />
<glyph unicode="&#x20;" d="" horiz-adv-x="512" />
<glyph unicode="&#xe600;" d="M896 192l-384 512-384-512h768z" />
<glyph unicode="&#xe601;" d="M128 704l384-512 384 512h-768z" />
<glyph unicode="&#xe602;" d="M896 256h-768l384 384 384-384z" />
<glyph unicode="&#xe603;" d="M512 256l-384 384h768l-384-384z" />
<glyph unicode="&#xe604;" d="M896 0l-768 448 768 448v-896z" />
<glyph unicode="&#xe605;" d="M128 896l768-448-768-448v896z" />
<glyph unicode="&#xe606;" d="M224.96 448.768l447.168 447.232 128-131.008-321.152-318.016 321.152-320.896-128.256-128.256-446.912 450.944z" />
<glyph unicode="&#xe607;" d="M353.152-2.112l-128.192 128.256 321.088 320.896-321.152 317.952 128 131.008 447.168-447.232-446.912-450.88z" />
<glyph unicode="&#xe608;" d="M928 351.936h-320v-319.936c0-35.392-28.608-64-64-64h-64c-35.328 0-64 28.608-64 64v319.936h-320c-35.328 0-64 28.736-64 64.064v64.064c0 35.328 28.672 63.872 64 63.872h320v320.064c0 35.328 28.672 64 64 64h64c35.392 0 64-28.672 64-64v-320.064h320c35.392 0 64-28.544 64-63.872v-64.064c0-35.328-28.608-64.064-64-64.064z" />
<glyph unicode="&#xe609;" d="M919.808 764.032c12.48-12.416 12.48-32.832 0-45.248l-248.896-249.024c-12.352-12.416-12.352-32.832 0-45.312l248.768-249.088c12.48-12.416 12.48-32.832 0-45.248l-90.624-90.432c-12.352-12.416-32.768-12.416-45.248 0l-248.64 249.088c-12.416 12.416-32.832 12.416-45.248 0l-248.896-248.896c-12.416-12.48-32.832-12.48-45.248 0l-90.496 90.624c-12.416 12.352-12.416 32.768 0 45.248l248.96 248.896c12.416 12.416 12.416 32.832 0 45.312l-248.768 249.024c-12.416 12.48-12.416 32.832 0 45.248l90.56 90.496c12.416 12.416 32.832 12.416 45.248 0l248.64-249.024c12.416-12.48 32.832-12.48 45.248-0.064l248.832 248.96c12.48 12.352 32.896 12.352 45.248 0l90.56-90.56z" />
<glyph unicode="&#xe60a;" d="M923.136 822.592c-12.352 12.544-32.768 12.544-45.12 0l-476.16-474.496c-12.48-12.544-32.832-12.544-45.248 0l-208.64 212.736c-6.144 6.208-14.272 9.408-22.336 9.472-8.256 0-16.576-3.008-22.848-9.472l-92.16-83.008c-6.144-6.272-9.472-14.144-9.472-22.336 0-8.32 3.328-17.024 9.472-23.232l210.368-220.992c12.416-12.48 32.832-33.024 45.248-45.632l90.432-91.264c12.416-12.48 32.768-12.48 45.248 0l611.712 611.328c12.48 12.48 12.48 33.088 0 45.632l-90.496 91.264z" />
<glyph unicode="&#xe60b;" d="M512 960c-281.6 0-512-230.4-512-512s230.4-512 512-512 512 230.4 512 512c0 281.6-230.4 512-512 512zM512 140.8c-168.96 0-307.2 138.24-307.2 307.2s138.24 307.2 307.2 307.2c168.96 0 307.2-138.24 307.2-307.2 0-168.96-138.24-307.2-307.2-307.2z" />
<glyph unicode="&#xe60c;" d="M512 960c-281.6 0-512-230.4-512-512s230.4-512 512-512 512 230.4 512 512c0 281.6-230.4 512-512 512zM512 140.8c-168.96 0-307.2 138.24-307.2 307.2s138.24 307.2 307.2 307.2c168.96 0 307.2-138.24 307.2-307.2 0-168.96-138.24-307.2-307.2-307.2zM512 601.6c-87.040 0-153.6-66.56-153.6-153.6s66.56-153.6 153.6-153.6 153.6 66.56 153.6 153.6c0 87.040-66.56 153.6-153.6 153.6z" />
<glyph unicode="&#xe60d;" d="M256 960h512c143.36 0 256-112.64 256-256v-512c0-143.36-112.64-256-256-256h-512c-143.36 0-256 112.64-256 256v512c0 143.36 112.64 256 256 256z" />
<glyph unicode="&#xe60e;" d="M768 960h-512c-143.36 0-256-112.64-256-256v-512c0-143.36 112.64-256 256-256h512c143.36 0 256 112.64 256 256v512c0 143.36-112.64 256-256 256zM844.8 550.4l-368.64-368.64c-5.12-5.12-20.48-5.12-25.6 0l-56.32 56.32c-5.12 5.12-20.48 20.48-25.6 25.6l-128 133.12c-5.12 5.12-5.12 10.24-5.12 15.36s0 10.24 5.12 15.36l56.32 51.2c5.12 0 10.24 5.12 10.24 5.12 5.12 0 10.24 0 15.36-5.12l122.88-128c5.12-5.12 20.48-5.12 25.6 0l286.72 286.72c5.12 5.12 20.48 5.12 25.6 0l56.32-56.32c10.24-10.24 10.24-20.48 5.12-30.72z" />
<glyph unicode="&#xe60f;" d="M512 960c-282.752 0-512-229.248-512-512 0-282.688 229.248-512 512-512 282.816 0 512 229.248 512 512 0 282.752-229.184 512-512 512zM576.768 195.136c0-37.056-28.992-67.072-64.768-67.072s-64.768 30.016-64.768 67.072v313.088c0 37.056 28.992 67.072 64.768 67.072s64.768-30.016 64.768-67.072v-313.088zM512 640.32c-35.776 0-64.768 28.608-64.768 63.872s28.992 63.744 64.768 63.744 64.768-28.544 64.768-63.808-28.992-63.808-64.768-63.808z" />
<glyph unicode="&#xe610;" d="M512 960c-282.752 0-512-229.248-512-512s229.248-512 512-512c282.752 0 512 229.248 512 512 0 282.752-229.248 512-512 512zM512 128.064c-35.776 0-64.768 28.544-64.768 63.808 0 35.2 28.992 63.808 64.768 63.808 35.776 0 64.768-28.608 64.768-63.808 0-35.264-28.992-63.808-64.768-63.808zM576.768 387.776c0-37.056-28.992-67.072-64.768-67.072-35.776 0-64.768 30.080-64.768 67.072v313.088c0 37.056 28.992 67.072 64.768 67.072 35.776 0 64.768-30.080 64.768-67.072v-313.088z" />
<glyph unicode="&#xe611;" d="M512-64c-282.752 0-512 229.248-512 512 0 282.688 229.248 512 512 512 282.752 0 512-229.248 512-512 0-282.752-229.248-512-512-512zM512 128.064c35.776 0 64.768 28.544 64.768 63.808 0 35.2-28.992 63.808-64.768 63.808-35.776 0-64.768-28.608-64.768-63.808 0-35.264 28.992-63.808 64.768-63.808zM650.752 724.288c-33.92 27.904-82.24 43.456-140.032 43.456-42.56 0-78.912-7.68-110.144-20.16-16.576-6.72-69.632-39.68-80.64-48.896l32.384-48.32c5.312-9.344 13.952-14.080 25.92-14.080 4.992 0 10.624 1.984 16.96 5.888 4.608 2.88 41.088 21.696 56.512 26.368 32.32 9.6 67.84 5.696 84.16 0.64 22.272-6.848 38.4-19.904 47.36-37.76 5.888-11.776 13.376-44.16-4.224-74.432-14.656-25.088-37.568-44.16-62.848-61.056-13.504-9.216-26.048-18.624-37.376-28.416-0.512 0-1.792-0.96-4.672-3.52 1.408 1.216 3.264 2.304 4.672 3.52 3.2 0.128-30.784-43.328-30.784-83.52 0-42.88 0-64 0-64h128v64c0 33.28 16.128 51.968 16.448 56.704 11.008 7.872 61.056 46.144 72.96 59.904 22.208 25.6 38.592 59.392 38.592 107.008 0 48.832-19.392 88.832-53.248 116.672z" />
<glyph unicode="&#xe612;" d="M512 960c-282.752 0-512-229.184-512-511.936 0-282.816 229.248-512.064 512-512.064 282.752 0 512 229.248 512 512.064 0 282.752-229.248 511.936-512 511.936zM842.88 552.128l-367.296-367.232c-7.488-7.488-19.712-7.488-27.136 0l-54.272 54.784c-7.424 7.552-19.712 19.904-27.136 27.392l-126.336 132.8c-3.712 3.712-5.696 8.96-5.696 13.888 0 4.992 1.984 9.728 5.696 13.504l55.36 49.92c3.776 3.84 8.768 5.632 13.696 5.632 4.864-0.064 9.728-1.984 13.44-5.632l125.248-127.872c7.488-7.616 19.648-7.616 27.136 0l285.888 285.12c7.424 7.488 19.712 7.488 27.136 0l54.336-54.912c7.424-7.488 7.424-19.84-0.064-27.392z" />
<glyph unicode="&#xe613;" d="M874.048 810.048c-199.936 200-524.096 199.936-724.096 0-199.936-199.872-199.936-524.096 0.064-724.032 199.936-199.936 524.096-199.936 724.032-0.064 200 199.936 200 524.16 0 724.096zM747.2 309.056c27.52-27.52 28.224-71.296 1.728-97.856-26.56-26.56-70.4-25.728-97.792 1.728l-139.072 139.008-139.584-139.584c-27.52-27.456-71.296-28.224-97.792-1.728-26.56 26.56-25.728 70.4 1.664 97.856l139.648 139.584-139.648 139.648c-27.456 27.392-28.224 71.168-1.664 97.728 26.496 26.56 70.336 25.792 97.792-1.664l139.584-139.584 139.072 139.072c27.456 27.456 71.232 28.224 97.792 1.664 26.496-26.56 25.728-70.336-1.728-97.792l-139.008-139.072 139.008-139.008z" />
<glyph unicode="&#xe614;" d="M512 960.064c-282.752 0-512-229.312-512-512.064 0-282.816 229.248-512.064 512-512.064s512 229.248 512 512.064c0 282.752-229.248 512.064-512 512.064zM764.224 383.296h-187.392v-187.52c0-36.992-28.992-67.072-64.768-67.072s-64.768 30.080-64.768 67.072v187.52h-188.16c-36.992 0-67.072 28.928-67.072 64.704s30.080 64.768 67.072 64.768h188.16v188.16c0 37.056 28.992 67.072 64.768 67.072s64.768-30.016 64.768-67.072v-188.16h187.456c37.056 0 67.072-29.056 67.072-64.768s-30.016-64.704-67.136-64.704z" />
<glyph unicode="&#xe615;" d="M288 960h-192c-35.328 0-64-28.608-64-64v-896c0-35.392 28.672-64 64-64h192c35.328 0 64 28.608 64 64v896c0 35.392-28.672 64-64 64zM928 960h-192c-35.392 0-64-28.608-64-64v-896c0-35.392 28.608-64 64-64h192c35.392 0 64 28.608 64 64v896c0 35.392-28.608 64-64 64z" />
<glyph unicode="&#xe616;" d="M880 475.776l-832 480c-9.856 5.696-22.144 5.696-32 0-9.856-5.76-16-16.32-16-27.776v-960c0-11.456 6.144-22.016 16-27.712 4.928-2.88 10.496-4.288 16-4.288s11.072 1.408 16 4.288l832 480c9.856 5.696 16 16.256 16 27.712s-6.144 22.016-16 27.776z" />
<glyph unicode="&#xe617;" d="M493.184 896c-48.384 0-63.040-27.84-63.040-27.84s-183.104-216.192-266.56-216.192c-82.176 0-81.344 0-81.344 0-45.44 0-82.24-36.416-82.24-81.28v-244.096c0-44.928 36.8-81.28 82.176-81.28 0 0 1.344 0 82.176 0 81.024 0 269.568-218.88 269.568-218.88 14.912-15.488 35.904-25.152 59.264-25.152 45.376 0 82.176 36.352 82.176 81.28v732.096c0 44.928-36.8 81.344-82.176 81.344zM843.968 817.728l-47.424-70.976c86.656-70.4 142.208-177.728 142.208-298.176s-55.488-227.84-142.208-298.112l47.424-70.976c109.44 85.888 180.032 219.136 180.032 369.088 0 150.016-70.592 283.2-180.032 369.152zM748.8 675.328l-47.872-71.68c41.344-38.912 67.392-93.76 67.392-155.072s-26.048-116.096-67.392-155.072l47.872-71.616c63.872 54.72 104.576 136 104.576 226.688 0 90.816-40.704 171.968-104.576 226.752z" />
<glyph unicode="&#xe618;" d="M492.8 896c-51.2 0-64-25.6-64-25.6s-179.2-217.6-262.4-217.6c-83.2 0-83.2 0-83.2 0-44.8 0-83.2-38.4-83.2-83.2v-243.2c0-44.8 38.4-83.2 83.2-83.2 0 0 0 0 83.2 0 83.2 0 268.8-217.6 268.8-217.6 12.8-12.8 32-25.6 57.6-25.6 44.8 0 83.2 38.4 83.2 83.2v729.6c0 44.8-38.4 83.2-83.2 83.2z" />
<glyph unicode="&#xe619;" d="M832 640l-213.056-208.448-125.696 125.696 210.752 210.688-160 160.064h448v-448l-160 160zM526.976 342.528l-206.976-202.496 167.488-172.032h-455.488v452.288l160-164.288 210.752 210.752 124.224-124.224z" />
<glyph unicode="&#xe61a;" d="M991.936 863.36h-959.872c-17.6 0-32-15.36-32-34.176v-124.672c0-18.048 14.4-32.832 32-32.832h959.872c17.6 0 32 14.72 32 32.832v124.672c0 18.816-14.4 34.176-32 34.176zM991.936 543.36h-959.872c-17.6 0-32-15.36-32-34.24v-124.608c0-18.112 14.4-32.832 32-32.832h959.872c17.6 0 32 14.72 32 32.832v124.672c0 18.816-14.4 34.176-32 34.176zM991.936 223.36h-959.872c-17.6 0-32-15.36-32-34.24v-124.608c0-17.984 14.4-32.768 32-32.768h959.872c17.6 0 32 14.72 32 32.768v124.608c0 18.88-14.4 34.24-32 34.24z" />
<glyph unicode="&#xe61b;" d="M352 896h-320c-19.2 0-32-12.8-32-32v-320c0-19.2 12.8-32 32-32h320c19.2 0 32 12.8 32 32v320c0 19.2-12.8 32-32 32zM352 384h-320c-19.2 0-32-12.8-32-32v-320c0-19.2 12.8-32 32-32h320c19.2 0 32 12.8 32 32v320c0 19.2-12.8 32-32 32zM992 896h-448c-19.2 0-32-12.8-32-32v-64c0-19.2 12.8-32 32-32h448c19.2 0 32 12.8 32 32v64c0 19.2-12.8 32-32 32zM992 640h-448c-19.2 0-32-12.8-32-32v-64c0-19.2 12.8-32 32-32h448c19.2 0 32 12.8 32 32v64c0 19.2-12.8 32-32 32zM992 384h-448c-19.2 0-32-12.8-32-32v-64c0-19.2 12.8-32 32-32h448c19.2 0 32 12.8 32 32v64c0 19.2-12.8 32-32 32zM992 128h-448c-19.2 0-32-12.8-32-32v-64c0-19.2 12.8-32 32-32h448c19.2 0 32 12.8 32 32v64c0 19.2-12.8 32-32 32z" />
<glyph unicode="&#xe61c;" d="M288 896h-192c-19.2 0-32-12.8-32-32v-192c0-19.2 12.8-32 32-32h192c19.2 0 32 12.8 32 32v192c0 19.2-12.8 32-32 32zM288 576h-192c-19.2 0-32-12.8-32-32v-192c0-19.2 12.8-32 32-32h192c19.2 0 32 12.8 32 32v192c0 19.2-12.8 32-32 32zM608 896h-192c-19.2 0-32-12.8-32-32v-192c0-19.2 12.8-32 32-32h192c19.2 0 32 12.8 32 32v192c0 19.2-12.8 32-32 32zM608 576h-192c-19.2 0-32-12.8-32-32v-192c0-19.2 12.8-32 32-32h192c19.2 0 32 12.8 32 32v192c0 19.2-12.8 32-32 32zM928 896h-192c-19.2 0-32-12.8-32-32v-192c0-19.2 12.8-32 32-32h192c19.2 0 32 12.8 32 32v192c0 19.2-12.8 32-32 32zM928 576h-192c-19.2 0-32-12.8-32-32v-192c0-19.2 12.8-32 32-32h192c19.2 0 32 12.8 32 32v192c0 19.2-12.8 32-32 32zM288 256h-192c-19.2 0-32-12.8-32-32v-192c0-19.2 12.8-32 32-32h192c19.2 0 32 12.8 32 32v192c0 19.2-12.8 32-32 32zM608 256h-192c-19.2 0-32-12.8-32-32v-192c0-19.2 12.8-32 32-32h192c19.2 0 32 12.8 32 32v192c0 19.2-12.8 32-32 32zM928 256h-192c-19.2 0-32-12.8-32-32v-192c0-19.2 12.8-32 32-32h192c19.2 0 32 12.8 32 32v192c0 19.2-12.8 32-32 32z" />
<glyph unicode="&#xe61d;" d="M416 960h-384c-19.2 0-32-12.8-32-32v-384c0-19.2 12.8-32 32-32h384c19.2 0 32 12.8 32 32v384c0 19.2-12.8 32-32 32zM992 960h-384c-19.2 0-32-12.8-32-32v-384c0-19.2 12.8-32 32-32h384c19.2 0 32 12.8 32 32v384c0 19.2-12.8 32-32 32zM416 384h-384c-19.2 0-32-12.8-32-32v-384c0-19.2 12.8-32 32-32h384c19.2 0 32 12.8 32 32v384c0 19.2-12.8 32-32 32zM992 384h-384c-19.2 0-32-12.8-32-32v-384c0-19.2 12.8-32 32-32h384c19.2 0 32 12.8 32 32v384c0 19.2-12.8 32-32 32z" />
<glyph unicode="&#xe61e;" d="M992 896h-768c-19.2 0-32-12.8-32-32v-64c0-19.2 12.8-32 32-32h768c19.2 0 32 12.8 32 32v64c0 19.2-12.8 32-32 32zM992 640h-768c-19.2 0-32-12.8-32-32v-64c0-19.2 12.8-32 32-32h768c19.2 0 32 12.8 32 32v64c0 19.2-12.8 32-32 32zM992 384h-768c-19.2 0-32-12.8-32-32v-64c0-19.2 12.8-32 32-32h768c19.2 0 32 12.8 32 32v64c0 19.2-12.8 32-32 32zM992 128h-768c-19.2 0-32-12.8-32-32v-64c0-19.2 12.8-32 32-32h768c19.2 0 32 12.8 32 32v64c0 19.2-12.8 32-32 32zM96 896h-64c-19.2 0-32-12.8-32-32v-64c0-19.2 12.8-32 32-32h64c19.2 0 32 12.8 32 32v64c0 19.2-12.8 32-32 32zM96 640h-64c-19.2 0-32-12.8-32-32v-64c0-19.2 12.8-32 32-32h64c19.2 0 32 12.8 32 32v64c0 19.2-12.8 32-32 32zM96 384h-64c-19.2 0-32-12.8-32-32v-64c0-19.2 12.8-32 32-32h64c19.2 0 32 12.8 32 32v64c0 19.2-12.8 32-32 32zM96 128h-64c-19.2 0-32-12.8-32-32v-64c0-19.2 12.8-32 32-32h64c19.2 0 32 12.8 32 32v64c0 19.2-12.8 32-32 32z" />
<glyph unicode="&#xe61f;" d="M992 896h-960c-19.2 0-32-12.8-32-32v-64c0-19.2 12.8-32 32-32h960c19.2 0 32 12.8 32 32v64c0 19.2-12.8 32-32 32zM992 640h-960c-19.2 0-32-12.8-32-32v-64c0-19.2 12.8-32 32-32h960c19.2 0 32 12.8 32 32v64c0 19.2-12.8 32-32 32zM992 384h-960c-19.2 0-32-12.8-32-32v-64c0-19.2 12.8-32 32-32h960c19.2 0 32 12.8 32 32v64c0 19.2-12.8 32-32 32zM992 128h-960c-19.2 0-32-12.8-32-32v-64c0-19.2 12.8-32 32-32h960c19.2 0 32 12.8 32 32v64c0 19.2-12.8 32-32 32z" />
<glyph unicode="&#xe620;" d="M992 832h-640c-19.2 0-32-12.8-32-32v-64c0-19.2 12.8-32 32-32h640c19.2 0 32 12.8 32 32v64c0 19.2-12.8 32-32 32zM992 512h-640c-19.2 0-32-12.8-32-32v-64c0-19.2 12.8-32 32-32h640c19.2 0 32 12.8 32 32v64c0 19.2-12.8 32-32 32zM992 192h-640c-19.2 0-32-12.8-32-32v-64c0-19.2 12.8-32 32-32h640c19.2 0 32 12.8 32 32v64c0 19.2-12.8 32-32 32zM256 768c0-70.692-57.308-128-128-128-70.692 0-128 57.308-128 128 0 70.692 57.308 128 128 128 70.692 0 128-57.308 128-128zM256 448c0-70.692-57.308-128-128-128-70.692 0-128 57.308-128 128 0 70.692 57.308 128 128 128 70.692 0 128-57.308 128-128zM256 128c0-70.692-57.308-128-128-128-70.692 0-128 57.308-128 128 0 70.692 57.308 128 128 128 70.692 0 128-57.308 128-128z" />
<glyph unicode="&#xe621;" d="M896 960h-768c-70.656 0-128-57.344-128-128v-768c0-70.656 57.344-128 128-128h768c70.656 0 128 57.344 128 128v768c0 70.656-57.344 128-128 128zM384 895.936c35.328 0 64-28.608 64-63.936 0-35.392-28.672-64-64-64s-64 28.608-64 64c0 35.328 28.672 63.936 64 63.936zM192 895.936c35.328 0 64-28.608 64-63.936 0-35.392-28.672-64-64-64s-64 28.608-64 64c0 35.328 28.672 63.936 64 63.936zM896.064 64h-768.064v640h768.064v-640z" />
<glyph unicode="&#xe622;" d="M938.752 767.744h-106.688v106.624c0 47.104-38.208 85.312-85.312 85.312h-661.44c-47.104 0-85.312-38.208-85.312-85.312v-660.672c0-47.168 37.248-85.376 83.136-85.376h108.864v-106.688c0-47.104 37.248-85.312 83.136-85.312h665.792c45.952 0 83.2 38.208 83.2 85.312v660.736c-0.064 47.104-38.272 85.376-85.376 85.376zM384 895.616c35.328 0 64-28.608 64-63.936 0-35.392-28.672-64-64-64s-64 28.608-64 64c0 35.328 28.672 63.936 64 63.936zM192 895.616c35.328 0 64-28.608 64-63.936 0-35.392-28.672-64-64-64s-64 28.608-64 64c0 35.328 28.672 63.936 64 63.936zM128 255.68l-0.064 448h576.064v-448h-576zM896 63.68h-576v64.64h428.864c45.952 0 83.2 38.208 83.2 85.376v297.984h63.936v-448z" />
<glyph unicode="&#xe623;" d="M768 191.936c-121.6 0-197.888 68.736-256 144.448-58.112-75.712-134.4-144.448-256-144.448-102.848 0-256 68.224-256 256.064 0 187.776 153.152 256 256 256 121.6 0 197.888-68.672 256-144.448 58.112 75.776 134.4 144.448 256 144.448 102.912 0 256-68.224 256-256 0-187.84-153.088-256.064-256-256.064zM256 576c-29.632-0.512-128-11.136-128-128 0-121.856 106.624-128 128-128 78.272 0 123.264 47.808 178.752 128-55.488 80.128-100.48 128-178.752 128zM589.248 448c55.424-80.128 100.352-127.872 178.432-128 30.336 0.448 128.32 11.264 128.32 128 0 121.856-106.624 128-128 128-78.272 0-123.264-47.872-178.752-128z" />
<glyph unicode="&#xe624;" d="M800 512c-22.976 0-59.328 0-96 0v-128c22.656 0 44.8 0 64 0 12.096 0 23.296 0 32 0 123.712 0 224-100.288 224-224s-100.288-224-224-224-224 100.224-224 224c0 22.976 0 59.264 0 96h-128c0-22.656 0-44.864 0-64 0-12.096 0-23.232 0-32 0-123.776-100.288-224-224-224s-224 100.224-224 224 100.288 224 224 224c22.976 0 59.328 0 96 0v128c-22.592 0-44.864 0-64 0-12.096 0-23.232 0-32 0-123.712 0-224 100.224-224 224 0 123.712 100.288 224 224 224s224-100.288 224-224c0-22.976 0-59.328 0-96h128c0 22.592 0 44.864 0 64 0 12.096 0 23.232 0 32 0 123.712 100.288 224 224 224s224-100.288 224-224c0-123.776-100.288-224-224-224zM320 736c0 52.992-43.008 96-96 96s-96-43.008-96-96c0-53.056 43.008-96 96-96 7.744 0 19.52 0 32 0 29.568 0 64 0 64 0s0 69.056 0 96zM320 192c0 29.504 0 64 0 64s-69.056 0-96 0c-52.992 0-96-43.008-96-96s43.008-96 96-96 96 43.008 96 96c0 7.744 0 19.52 0 32zM704 160c0-52.992 43.008-96 96-96s96 43.008 96 96-43.008 96-96 96c-7.744 0-19.52 0-32 0-29.568 0-64 0-64 0s0-69.12 0-96zM576 512h-128v-128h128v128zM800 832c-52.992 0-96-43.008-96-96 0-7.744 0-19.456 0-32 0-29.632 0-64 0-64s69.056 0 96 0c52.992 0 96 42.944 96 96 0 52.992-43.008 96-96 96z" />
<glyph unicode="&#xe625;" d="M801.984 406.4c-28.672 17.664-65.408 7.232-81.92-23.36-0.576-1.024-0.576-2.24-1.152-3.264l-1.472 0.96c-41.984-74.432-117.696-124.736-205.184-124.736s-163.136 50.304-205.184 124.736l-1.408-0.832c-0.704 1.6-0.704 3.456-1.6 5.12-16.576 30.528-53.312 41.024-82.048 23.36s-38.528-56.832-21.952-87.36c1.28-2.24 3.264-3.648 4.672-5.696l-1.088-0.704c53.12-94.208 143.104-161.6 248.576-180.608v-70.016h-120.064c-33.152 0-60.032-28.672-60.032-64 0-35.392 26.88-64 60.032-64h360.128c33.216 0 60.032 28.608 60.032 64 0 35.328-26.816 64-60.032 64h-120v69.952c105.472 19.008 195.456 86.528 248.576 180.672l-0.384 0.256c1.088 1.472 2.624 2.432 3.456 4.096 16.64 30.656 6.784 69.76-21.952 87.424zM512.256 320c99.456 0 180.032 85.952 180.032 192v256c0 106.048-80.64 192-180.032 192-99.456 0-180.096-85.952-180.096-192v-256c0-106.048 80.64-192 180.096-192z" />
<glyph unicode="&#xe626;" d="M948.544 446.848c100.48 102.784 100.352 269.312 0 372.032-51.392 52.48-118.976 78.144-186.24 76.992-94.144-1.536-249.344-128.96-249.344-128.96s-159.616 129.216-256 129.088c-65.728-0.128-131.392-25.856-181.504-77.056-100.416-102.784-100.48-269.248 0-372.032l436.544-446.336 436.544 446.272z" />
<glyph unicode="&#xe627;" d="M512.128 432.064c-87.872 0-159.104 73.728-159.104 164.8 0 91.136 71.232 164.864 159.104 164.864s159.104-73.728 159.104-164.864c0-91.008-71.232-164.8-159.104-164.8zM512.128 960.384c-194.496 0-352.128-163.328-352.128-364.8 0-190.272 159.488-435.776 265.984-555.264 39.808-44.544 86.144-104.704 86.144-104.704s49.792 60.352 92.48 106.304c106.368 114.496 259.648 344.448 259.648 553.6 0 201.536-157.632 364.864-352.128 364.864z" />
<glyph unicode="&#xe628;" d="M960.512 710.272c-21.76 35.968-48.576 71.168-81.344 103.808-33.216 32.896-68.992 59.968-105.6 81.6l64.32 64.32c0 0 93.056 0 139.648-46.528 46.464-46.592 46.464-139.648 46.464-139.648l-63.488-63.552zM387.2 128.768h-194.432v194.432l23.36 23.36c39.552-18.56 78.784-44.928 114.176-80.32 35.392-35.328 61.696-74.688 80.32-114.176l-23.424-23.296zM906.752 656.512l-440-448.32c-22.72 37.632-50.688 74.304-84.992 108.352-34.688 34.432-72.064 62.72-110.336 85.312l449.152 440.896c37.824-17.856 75.456-42.944 109.312-76.864s59.008-71.424 76.864-109.376zM128 832v-767.936h768v319.936l128 127.936v-482.88c0-51.392-41.6-93.056-93.056-93.056h-837.888c-51.392 0-93.056 41.664-93.056 93.056v837.824c0 51.456 41.664 93.12 93.056 93.12h482.944l-128-128h-320z" />
<glyph unicode="&#xe629;" d="M960.256 96.064v-0.768l-256.256 256.256v-127.488c0-70.72-57.344-128.064-128-128.064h-448c-70.656 0-128 57.344-128 128.064v447.872c0 70.72 57.344 128.064 128 128.064h448c70.656 0 128-57.344 128-128.064v-128.576l256 256v0.64c35.392 0 64-28.608 64-64v-576c0-35.264-28.544-63.808-63.744-63.936z" />
<glyph unicode="&#xe62a;" d="M897.024 768h-147.84l-42.88 90.624c-9.792 21.312-45.056 37.376-79.36 37.376h-244.8c-34.304 0-69.568-16.064-79.424-37.376l-41.856-90.624h-132.864c-128 0-128-64-128-64v-640c0 0 0-64 128-64h768c128 0 128 64 128 64v640c0 0 0 64-126.976 64zM512 128.064c-141.376 0-256 114.496-256 255.872 0 141.44 114.624 256.064 256 256.064s256-114.624 256-256.064c0-141.376-114.624-255.872-256-255.872zM512 544c-88.384 0-160-71.616-160-160 0-88.32 71.616-160 160-160s160 71.68 160 160c0 88.384-71.616 160-160 160z" />
<glyph unicode="&#xe62b;" d="M512.064 960c-282.688 0-511.872-229.184-511.872-511.936 0-282.816 229.184-511.936 511.872-511.936 282.752 0 511.936 229.12 511.936 511.936 0 282.752-229.184 511.936-511.936 511.936zM678.976 268.48l-14.848-14.976c-12.416-12.352-33.344-12.992-46.464-1.28l-171.52 147.52c-13.12 11.712-23.040 35.712-22.208 53.248l17.856 283.072c0.896 17.6 16 31.936 33.664 31.936h21.056c17.6 0 32.704-14.336 33.536-31.936l14.656-231.808c0.896-17.536 11.2-42.688 22.848-55.808l112.768-133.568c11.648-12.992 11.136-33.984-1.344-46.4z" />
<glyph unicode="&#xe62c;" d="M512.064 800c-338.944 0-512.96-352.896-512.96-352.896s131.328-352.96 512.96-352.96c345.472 0 512.832 351.616 512.832 351.616s-168.64 354.24-512.832 354.24zM512.832 226.496c-123.968 0-213.504 96.576-213.504 220.608 0 124.096 89.536 220.544 213.504 220.544 123.904 0 213.44-96.448 213.44-220.544 0-124.032-89.6-220.608-213.44-220.608zM512.832 579.456c-70.784-0.128-128.128-61.44-128.128-132.352 0-70.848 57.344-132.352 128.128-132.352s128.064 61.504 128.064 132.352c0 70.912-57.28 132.544-128.064 132.352z" />
<glyph unicode="&#xe62d;" d="M457.856 168.064l289.28-226.496c4.736-3.776 7.616-5.632 10.368-5.632 8 0 10.496 5.504 10.496 14.528v214.4c0 15.104 9.984 27.136 23.36 27.136h105.152c127.488 0 127.36 61.44 127.36 61.44v640.064c0 0 0 66.56-127.872 66.56h-767.936c-128 0-128-66.56-128-66.56v-640.064c0 0-0.064-61.44 128.448-61.44h256c0 0 53.568-1.472 73.344-23.936z" />
<glyph unicode="&#xe62e;" d="M1024 26.752c0-50.176-41.6-90.752-93.12-90.752h-291.264v351.68c0 53.056-38.016 96.128-85.056 96.128h-85.12c-46.976 0-85.12-43.072-85.12-96.128v-351.68h-291.264c-51.392 0-93.056 40.576-93.056 90.752v478.976c0 23.36 9.344 44.48 24.192 60.544l-0.96 1.856 425.92 372.992c34.304 25.152 89.984 25.152 124.288 0l427.264-372.992-0.448-2.368c14.592-16.064 23.744-36.928 23.744-60.032v-478.976z" />
<glyph unicode="&#xe62f;" d="M896-64h-192v128h192.064v640h-768.064v-640h192v-128h-192c-70.656 0-128 57.344-128 128v768c0 70.656 57.344 128 128 128h768c70.656 0 128-57.344 128-128v-768c0-70.656-57.344-128-128-128zM192 895.936c-35.392 0-64-28.608-64-63.936 0-35.392 28.608-64 64-64s64 28.608 64 64c0 35.328-28.608 63.936-64 63.936zM384 895.936c-35.392 0-64-28.608-64-63.936 0-35.392 28.608-64 64-64s64 28.608 64 64c0 35.328-28.608 63.936-64 63.936zM271.936 200.704c-22.208 23.232-22.208 60.864 0 84.16l196.928 209.408c6.144 6.464 13.44 10.496 21.12 13.44 0.064 0.064 0.192 0.064 0.32 0.128 5.888 2.24 11.84 3.456 17.984 3.712 2.24 0.192 4.416 0.384 6.656 0.256 2.752-0.192 5.376-1.024 8-1.6 11.328-2.24 22.272-6.72 30.976-15.872l196.864-209.408c22.272-23.296 22.272-60.928 0-84.16-22.272-23.104-58.304-23.104-80.576 0l-94.208 119.232v-319.936c0-34.176-32.064-64.064-64.64-64.064-32.512 0-63.36 29.888-63.36 64.064v319.936l-95.488-119.296c-22.272-23.168-58.304-23.168-80.576 0z" />
<glyph unicode="&#xe630;" d="M723.392 353.6c-11.328 11.456-15.104 32.704-8.384 47.296 0 0 47.232 102.464 47.232 177.728 0 210.624-170.432 381.376-380.736 381.376s-380.8-170.752-380.8-381.312c0-210.624 170.496-381.376 380.8-381.376 75.2 0 177.408 47.36 177.408 47.36 14.656 6.784 35.968 2.944 47.232-8.448l291.456-291.776c11.456-11.392 30.080-11.392 41.344 0l75.776 75.904c11.456 11.456 11.456 30.144 0 41.472l-291.328 291.776zM381.504 373.376c-113.088 0-205.056 92.032-205.056 205.312 0 113.216 92.032 205.312 205.056 205.312s204.992-92.096 204.992-205.312c0-113.28-91.904-205.312-204.992-205.312z" />
<glyph unicode="&#xe631;" d="M449.024 596.288c106.56 0 193.024 81.344 193.024 181.888-0.064 100.416-86.464 181.824-193.024 181.824s-193.024-81.408-193.024-181.824c0-100.48 86.464-181.888 193.024-181.888zM600.32 583.68c-42.56-29.44-94.592-47.424-151.296-47.424-56.96 0-109.12 18.112-151.744 47.744-173.248-37.312-297.28-136.832-297.28-254.016v-258.88c0-17.152 14.4-31.104 32-31.104h64c17.6 0 32 12.608 32 28.096 0 8.96 0 201.856 0 201.856 0 16.64 9.536 9.984 21.376 9.984 11.776 0 21.312-9.024 21.312-19.968l0.32-179.968c0.896-10.368 9.6-84.416 20.544-86.592 0 0 66.56-57.344 256.448-57.344 191.232 0 256.448 57.344 256.448 57.344 10.944 2.112 19.712 76.16 20.544 86.592l0.32 179.968c0 11.008 9.536 19.968 21.376 19.968 11.776 0 21.312-9.024 21.312-19.968 0 0 0-182.912 0-191.872 0-15.488 14.4-28.096 32-28.096h64c17.6 0 32 14.016 32 31.104v258.88c0 116.864-123.392 216.128-295.68 253.696z" />
<glyph unicode="&#xe632;" d="M896 864c-50.496 0-768 0-768 0-50.496 0-128-41.152-128-90.944v-18.112c0 0 432.768-361.856 512-361.856s512 360.704 512 360.704v19.2c0 49.856-77.504 91.008-128 91.008zM0 608.96v-512.896c0 0 0-64.064 128-64.064h768c128.192 0 128 64.064 128 64.064v514.496c0 0-364.16-324.992-512-324.992-146.304 0-512 323.392-512 323.392z" />
<glyph unicode="&#xe633;" d="M896-64h-768c-35.328 0-64 28.608-64 64.064v447.936c0 35.328 28.672 64 64 64h64v128c0 176.704 143.232 320 320 320s320-143.296 320-320v-128h64c35.392 0 64-28.672 64-64v-447.936c0-35.456-28.608-64.064-64-64.064zM704 640c0 105.984-85.952 192-192 192s-192-86.016-192-192v-128h384v128z" />
<glyph unicode="&#xe634;" d="M767.872 787.008l-0.128-0.064c-0.896 0.64-1.6 1.536-2.624 2.24-29.184 20.032-68.992 12.608-89.024-16.704-19.968-29.312-12.48-69.312 16.64-89.344 0.768-0.64 1.536-0.896 2.24-1.28l-0.256-0.448c82.88-58.048 137.28-154.496 137.28-263.744 0-177.536-143.296-321.472-320-321.472s-320 143.936-320 321.472c0 109.248 54.4 205.696 137.28 263.744l-0.256 0.448c0.704 0.384 1.472 0.64 2.24 1.216 29.184 20.032 36.608 60.032 16.64 89.344-20.032 29.312-59.84 36.8-89.024 16.704-0.96-0.704-1.728-1.536-2.688-2.24l-0.064 0.128c-116.032-81.408-192.128-216.32-192.128-369.344 0-248.576 200.576-450.176 448-450.176s448 201.6 448 450.176c0 153.024-76.096 287.936-192.128 369.344zM512 352c35.392 0 64 28.608 64 64v447.936c0 35.392-28.608 64.064-64 64.064-35.328 0-64-28.672-64-64.064v-447.936c0-35.392 28.672-64 64-64z" />
<glyph unicode="&#xe635;" d="M320 576c-35.328 0-64-28.608-64-64s28.672-64 64-64 64 28.608 64 64-28.672 64-64 64zM512 384c-35.328 0-64-28.608-64-64s28.672-64 64-64 64 28.608 64 64-28.672 64-64 64zM320 384c-35.328 0-64-28.608-64-64s28.672-64 64-64 64 28.608 64 64-28.672 64-64 64zM896 895.936h-128c0 35.392-28.608 64.064-64 64.064s-64-28.672-64-64.064h-256c0 35.392-28.672 64.064-64 64.064s-64-28.672-64-64.064h-128c-70.656 0-128-57.28-128-127.936v-640c0-70.72 57.344-128 128-128h768c70.656 0 128 57.28 128 128v640c0 70.656-57.344 127.936-128 127.936zM896 128h-768v640h128c0-35.392 28.672-64 64-64s64 28.608 64 64h256c0-35.392 28.608-64 64-64s64 28.608 64 64h128v-640zM704 576c-35.392 0-64-28.608-64-64s28.608-64 64-64 64 28.608 64 64-28.608 64-64 64zM512 576c-35.328 0-64-28.608-64-64s28.672-64 64-64 64 28.608 64 64-28.672 64-64 64zM704 384c-35.392 0-64-28.608-64-64s28.608-64 64-64 64 28.608 64 64-28.608 64-64 64z" />
<glyph unicode="&#xe636;" d="M918.272 527.040c-17.344 2.56-35.968 18.304-41.344 35.008l-26.112 63.232c-8.128 15.552-6.272 39.872 4.352 53.952l42.112 56.192c10.624 14.080 9.728 36.352-1.984 49.536l-46.272 46.4c-13.12 11.712-35.52 12.544-49.6 1.984l-56.128-42.24c-14.144-10.496-38.4-12.48-54.016-4.288l-63.168 26.048c-16.832 5.312-32.64 24-35.008 41.472l-9.984 69.504c-2.496 17.408-18.816 33.152-36.352 34.944 0 0-10.816 1.216-32.768 1.216s-32.768-1.216-32.768-1.216c-17.536-1.792-33.92-17.536-36.352-34.944l-9.984-69.504c-2.432-17.472-18.176-36.16-35.008-41.472l-63.168-26.048c-15.552-8.192-39.808-6.208-53.888 4.288l-56.256 42.24c-14.016 10.624-36.416 9.728-49.6-1.984l-46.208-46.272c-11.648-13.184-12.544-35.52-1.984-49.6l42.176-56.192c10.56-14.080 12.48-38.4 4.288-53.952l-26.048-63.296c-5.376-16.704-24-32.448-41.408-35.008l-69.504-9.792c-17.472-2.56-33.216-18.88-35.008-36.416 0 0-1.152-10.88-1.152-32.832 0-21.952 1.152-32.896 1.152-32.896 1.856-17.472 17.6-33.792 35.008-36.288l69.504-9.856c17.408-2.496 36.032-18.304 41.408-35.008l26.112-63.232c8.192-15.616 6.272-39.808-4.288-53.888l-42.176-56.256c-10.56-14.144-13.12-33.28-5.632-42.496 7.424-9.216 28.864-32.064 28.928-32.064 0-0.128 7.232-6.72 16-14.656 8.768-8.064 44.48-19.2 58.56-8.64l56.256 42.112c14.080 10.624 38.336 12.544 53.888 4.352l63.040-25.984c16.832-5.44 32.576-24 35.008-41.472l9.984-69.504c2.432-17.344 18.816-33.28 36.288-35.072 0 0 10.88-1.152 32.832-1.152s32.768 1.152 32.768 1.152c17.472 1.792 33.856 17.664 36.352 35.072l9.984 69.504c2.368 17.472 18.112 36.032 35.008 41.472l63.104 25.984c15.616 8.192 39.872 6.272 54.016-4.224l56.256-42.24c14.144-10.56 36.352-9.664 49.6 1.92l46.272 46.336c11.648 13.184 12.48 35.52 1.856 49.6l-42.112 56.256c-10.624 14.080-12.48 38.272-4.352 53.888l26.112 63.232c5.376 16.768 24 32.512 41.344 35.008l69.504 9.856c17.344 2.496 33.152 18.816 35.008 36.288 0 0 1.152 10.88 1.152 32.896 0 21.952-1.152 32.832-1.152 32.832-1.856 17.536-17.6 33.856-35.008 36.416l-69.44 9.792zM512 320c-70.656 0-128 57.344-128 128 0 70.72 57.344 128 128 128 70.592 0 128-57.344 128-128 0-70.656-57.344-128-128-128z" />
<glyph unicode="&#xe637;" d="M768 697.024v0h128c35.392 0 64-28.672 64-64v-640c0-35.392-28.608-64-64-64h-672c-88.384 0-160 71.616-160 160v703.936c0 88.384 71.616 160.064 160 160.064h672c35.392 0 64-28.672 64-64 0-35.392-28.608-64.064-64-64.064h-640c-35.328 0-64-28.608-64-64s28.672-64 64-64h128v-256l64 64 64-64v256h256z" />
<glyph unicode="&#xe638;" d="M0 64v192h128v-192.128h640v768.128h-640v-192h-128v192c0 70.656 57.344 128 128 128h640c70.72 0 128-57.344 128-128v-768c0-70.72-57.28-128-128-128h-640c-70.656 0-128 57.28-128 128zM264.768 688c23.232 22.272 60.864 22.272 84.096 0l209.408-196.8c6.528-6.208 10.496-13.568 13.504-21.184 0.064-0.128 0.064-0.192 0.128-0.32 2.24-5.824 3.456-11.84 3.648-17.984 0.256-2.24 0.448-4.416 0.256-6.72-0.128-2.688-1.024-5.248-1.664-7.936-2.176-11.264-6.656-22.208-15.872-30.976l-209.408-196.8c-23.232-22.272-60.864-22.272-84.096 0-23.168 22.272-23.168 58.24 0 80.512l119.232 94.208h-320c-34.112 0-64 32.064-64 64.64 0 32.512 29.888 63.36 64 63.36h320l-119.232 95.552c-23.232 22.144-23.232 58.304 0 80.448z" />
<glyph unicode="&#xe639;" d="M928 704h-64v-640c0 0-1.984-128-128-128 0 0-318.016 0-448 0s-128 128-128 128v640h-64c-35.328 0-64 28.672-64 64s28.672 64 64 64h320v32c0 53.056 42.944 96 96 96 52.992 0 96-42.944 96-96v-32h320c35.392 0 64-28.608 64-64s-28.608-64-64-64zM736 704h-448v-640h448v640zM416 640c35.328 0 64-28.672 64-64v-384c0-35.392-28.672-64-64-64s-64 28.608-64 64v384c0 35.328 28.672 64 64 64zM608 640c35.392 0 64-28.672 64-64v-384c0-35.392-28.608-64-64-64s-64 28.608-64 64v384c0 35.328 28.608 64 64 64z" />
<glyph unicode="&#xe63a;" d="M896 768c0 0-278.016 0.064-320 0.064s-89.984 127.936-128 127.936-320 0-320 0c-70.656 0-128-57.28-128-128v-640.064c0-126.656 128-128 128-128h768c70.656 0 128 57.344 128 128v512c0 70.72-57.344 128.064-128 128.064zM896.064 127.936h-768.064v640.064c0 0 214.016 0 254.016 0s89.984-128 128-128c40 0 386.048 0 386.048 0v-512.064z" />
<glyph unicode="&#xe63b;" d="M895.424 960.064h-767.872c-127.296 0-127.552-128.064-127.552-128.064v-511.936c0 0 0.704-128.064 128-128.064h256c0 0 53.568-1.472 73.344-23.936l289.344-226.496c4.736-3.776 7.616-5.632 10.432-5.632 8 0 10.368 5.504 10.368 14.592v214.336c0 15.104 9.984 27.2 23.424 27.2h105.088c125.312 0 128 128.064 128 128.064v511.872c0 0-1.28 128.064-128.576 128.064zM896 320.064h-256v-128l-164.608 128h-347.392v511.936h768v-511.936z" />
<glyph unicode="&#xe63c;" d="M896 63.872h-768v768h320v128l-358.976 0.064c-49.152 0-89.024-39.936-89.024-89.088v-845.952c0-49.152 39.872-89.024 89.024-89.024h845.952c49.152 0 89.024 39.872 89.024 89.024v358.976h-128v-320zM1024 896c0 14.656-6.080 27.52-14.72 38.272-1.344 1.728-2.048 3.712-3.584 5.312-0.192 0.128-0.256 0.384-0.384 0.576-0.384 0.32-0.448 0.832-0.832 1.216-4.096 4.096-9.152 6.528-13.952 9.28-2.112 1.216-3.84 3.008-6.080 3.968-8.704 3.776-17.92 5.376-27.264 5.12-0.128 0-0.256 0.064-0.384 0.064h-313.024c-36.992 0.064-67.008-28.544-67.008-63.808 0-35.2 30.080-63.808 67.136-63.808h161.216l-402.56-403.328c-24.832-24.768-24.832-64.768 0-89.472 24.832-24.768 65.024-24.768 89.792 0l403.968 403.52v-163.2c0-37.056 28.608-67.072 63.872-67.072s63.808 30.016 63.808 67.072v313.024c0 0.64-0.32 1.152-0.32 1.728 0 0.512 0.32 1.024 0.32 1.536z" />
<glyph unicode="&#xe63d;" d="M0 576.448v107.712c0 45.952 38.208 83.136 85.312 83.136h107.392v90.432c0 21.056 21.568 102.208 48.192 102.208h96.384c26.624 0 48.192-81.152 48.192-102.208v-90.432h319.232v90.432c0 21.056 21.632 102.208 48.192 102.208h96.384c26.624 0 48.192-81.152 48.192-102.208v-90.432h41.28c47.168 0 85.376-37.184 85.376-83.136v-107.776h-1024.128zM1024.064 511.36v-492.224c0-45.952-38.208-83.2-85.376-83.2h-853.376c-47.104 0-85.312 37.248-85.312 83.2v492.224h1024.064z" />
<glyph unicode="&#xe63e;" d="M32 447.936c288 32.064 448 192.064 480 480.064 32.064-288 192.064-448 480.128-480.064-288.064-32-448.064-192-480.128-480-32 288-192 448-480 480z" />
<glyph unicode="&#xe63f;" d="M1024 448l-380.8-128-10.304-384-245.696 304.96-387.2-109.376 228.992 316.416-228.992 316.416 387.2-109.312 245.696 304.896 10.304-384 380.8-128z" />
<glyph unicode="&#xe640;" d="M768 223.552c35.392 0 64 28.672 64 64.064s-28.608 64.064-64 64.064-64-28.672-64-64.064 28.608-64.064 64-64.064zM938.752 864h-853.376c-47.168 0-85.376-38.208-85.376-85.376v-661.184c0-47.168 38.208-85.44 85.376-85.44h853.376c47.104 0 85.312 38.272 85.312 85.44v661.184c0 47.168-38.208 85.376-85.312 85.376zM896.064 160.192h-768.064v255.552h768.064v-255.552zM896.064 607.872h-768.064v128.064h768.064v-128.064z" />
<glyph unicode="&#xe641;" d="M939.712 875.712c-112.448 112.448-294.784 112.448-407.296-0.064l-448-448c-112.512-112.512-112.512-294.848-0.064-407.296s294.784-112.512 407.296 0l94.848 92.16c-51.008 1.152-97.536 17.728-136.96 44.672l-48.448-46.4c-62.528-62.528-163.84-62.528-226.304 0-62.464 62.464-62.464 163.84 0.064 226.304l448 448c62.528 62.528 163.84 62.528 226.24 0 62.528-62.528 62.592-163.776 0.064-226.24l-223.232-224.768c-18.752-18.752-49.152-18.752-67.904 0s-18.752 49.152 0 67.904l168.576 170.176c12.48 12.48 12.544 32.768 0 45.248l-45.248 45.248c-12.48 12.48-32.768 12.48-45.248 0l-168.576-170.176c-68.736-68.736-68.736-180.16 0-248.896s180.16-68.736 248.896 0l223.232 224.832c112.448 112.448 112.448 294.848 0.064 407.296z" />
<glyph unicode="&#xe642;" d="M939.648 875.648c-54.464 54.4-126.784 84.352-203.648 84.352-76.928 0-149.248-29.952-203.648-84.352 0 0-181.696-181.632-192.128-191.936-54.208-54.336-84.096-126.72-84.224-204.096 0.128-76.8 30.080-148.992 84.352-203.264l23.36-23.424c6.272-6.272 14.528-9.344 22.656-9.344 8.192 0 16.384 3.136 22.656 9.344l45.248 45.248c12.48 12.48 12.48 32.768 0 45.248l-23.424 23.424c-61.376 61.376-62.208 162.048-1.792 224.512 1.856 1.856 193.856 193.792 193.856 193.792 30.208 30.208 70.336 46.848 113.088 46.848s82.88-16.64 113.152-46.784v-0.064c62.528-62.592 62.528-163.776 0-226.24l-9.856-9.856c15.424-41.6 24.64-86.208 24.704-133.056 0-8.512-1.216-16.704-1.664-25.024l77.312 77.376c112.448 112.512 112.384 294.912 0 407.296zM660.16 643.136c-6.208 6.272-14.464 9.344-22.592 9.344-8.256 0-16.448-3.136-22.656-9.344l-45.248-45.248c-12.544-12.48-12.544-32.768 0-45.248l23.36-23.424c61.376-61.376 62.272-162.048 1.856-224.512-1.856-1.856-193.856-193.792-193.856-193.792-30.144-30.272-70.272-46.912-113.088-46.912-42.688 0-82.816 16.64-113.088 46.784v0.064c-62.528 62.592-62.528 163.776-0.064 226.24l9.92 9.856c-15.488 41.6-24.704 86.208-24.704 133.056 0 8.512 1.152 16.704 1.664 25.024l-77.312-77.376c-112.512-112.512-112.448-294.848 0-407.232 54.464-54.464 126.784-84.416 203.648-84.416s149.184 29.952 203.648 84.352c0 0 181.696 181.632 192.128 191.936 54.208 54.336 84.096 126.72 84.224 204.096-0.128 76.8-30.144 148.992-84.352 203.264l-23.488 23.488z" />
<glyph unicode="&#xe643;" d="M1012.736 484.16l-241.216 352c-11.968 17.408-31.68 27.84-52.8 27.84h-654.72c-35.392 0-64-28.672-64-64v-704c0-35.328 28.608-64 64-64h654.72c21.12 0 40.896 10.368 52.8 27.84l241.216 352c15.040 21.76 15.040 50.56 0 72.32zM736 352c-52.992 0-96 43.008-96 96s43.008 96 96 96 96-43.008 96-96-43.008-96-96-96z" />
<glyph unicode="&#xe644;" d="M842.752 960h-660.544c-47.552 0-86.208-38.144-86.208-64v-853.376c0-68.416 38.656-106.624 86.208-106.624h660.544c47.040 0 85.248 38.208 85.248 85.312v853.376c0 47.168-38.208 85.312-85.248 85.312zM544 128h-256c-35.392 0-64 28.608-64 64s28.608 64 64 64h256c35.392 0 64-28.608 64-64s-28.608-64-64-64zM736 384h-448c-35.392 0-64 28.608-64 64s28.608 64 64 64h448c35.392 0 64-28.608 64-64s-28.608-64-64-64zM736 640h-448c-35.392 0-64 28.608-64 64s28.608 64 64 64h448c35.392 0 64-28.608 64-64s-28.608-64-64-64z" />
<glyph unicode="&#xe645;" d="M938.752 32h-853.376c-47.168 0-85.376 37.248-85.376 83.264v665.472c0 46.016 38.208 83.264 85.376 83.264h853.376c47.104 0 85.312-37.248 85.312-83.264v-665.472c0-46.016-38.208-83.264-85.312-83.264zM896.064 736h-768.064v-511.808c0 0 64 64.064 128 128.064 64 64.064 128 0 128 0l64-64c0 0 118.72 120.768 192 192.128 66.88 66.944 128 0 128 0l128-128.128 0.064 383.744zM320 480c-35.328 0-64 28.672-64 63.936 0 35.392 28.672 64.064 64 64.064s64-28.672 64-64.064c0-35.264-28.672-63.936-64-63.936z" />
<glyph unicode="&#xe646;" d="M928-64h-832c-51.2 0-96 44.8-96 96v832c0 51.2 44.8 96 96 96h825.6c57.6 0 102.4-44.8 102.4-96v-825.6c0-57.6-44.8-102.4-96-102.4zM748.8 768c-121.6 0-172.8-83.2-172.8-166.4v-89.6h-64v-128h64v-384h128v384h128v128h-128v70.4c0 38.4 6.4 57.6 51.2 57.6h76.8v121.6s-38.4 6.4-83.2 6.4z" />
<glyph unicode="&#xe647;" d="M1017.6 646.4c0 83.2-64 147.2-147.2 147.2-115.2 6.4-236.8 6.4-358.4 6.4-121.6 0-243.2 0-358.4-6.4-83.2 0-147.2-64-147.2-147.2-6.4-70.4-6.4-134.4-6.4-198.4s0-128 6.4-198.4c0-83.2 64-147.2 147.2-147.2 115.2-6.4 236.8-6.4 358.4-6.4 121.6 0 243.2 0 358.4 6.4 83.2 0 147.2 64 147.2 147.2 6.4 64 6.4 128 6.4 198.4 0 64 0 128-6.4 198.4zM384 224v448l320-224-320-224z" />
<glyph unicode="&#xe648;" d="M876.8 896c-147.2 6.4-243.2-76.8-294.4-243.2 25.6 12.8 51.2 19.2 76.8 19.2 51.2 0 76.8-32 70.4-89.6 0-38.4-25.6-89.6-70.4-153.6-38.4-70.4-70.4-102.4-96-102.4-25.6 0-51.2 51.2-76.8 160-6.4 25.6-19.2 108.8-38.4 236.8-19.2 115.2-70.4 172.8-147.2 160-32 0-83.2-32-153.6-96-44.8-38.4-96-83.2-147.2-128l51.2-64c44.8 32 70.4 51.2 76.8 51.2 38.4 0 70.4-57.6 96-166.4 32-108.8 57.6-211.2 83.2-313.6 38.4-108.8 89.6-166.4 153.6-166.4 96 0 211.2 89.6 352 275.2 134.4 179.2 204.8 313.6 211.2 416 6.4 134.4-44.8 204.8-147.2 204.8z" />
<glyph unicode="&#xe649;" d="M1024 768c-38.4-19.2-76.8-25.6-121.6-32 44.8 25.6 76.8 64 89.6 115.2-38.4-25.6-83.2-38.4-134.4-51.2-38.4 38.4-96 64-153.6 64-108.8 0-204.8-96-204.8-211.2 0-19.2 0-32 6.4-44.8-172.8 6.4-332.8 89.6-435.2 217.6-19.2-32-25.6-64-25.6-102.4 0-70.4 38.4-134.4 96-172.8-32 0-64 12.8-96 25.6 0-102.4 70.4-185.6 166.4-204.8-19.2-12.8-38.4-12.8-57.6-12.8-12.8 0-25.6 0-38.4 6.4 25.6-83.2 102.4-147.2 198.4-147.2-70.4-57.6-160-89.6-262.4-89.6h-51.2c96-64 204.8-96 320-96 384 0 595.2 320 595.2 595.2v25.6c44.8 32 83.2 70.4 108.8 115.2z" />
<glyph unicode="&#xe64a;" d="M179.2 57.6c76.8 115.2 211.2 185.6 358.4 185.6 134.4 0 256-64 339.2-160 89.6 96 147.2 224 147.2 364.8 0 281.6-230.4 512-512 512s-512-230.4-512-512c0-153.6 70.4-294.4 179.2-390.4zM787.2 294.4c-6.4-19.2-19.2-19.2-38.4-12.8-70.4 32-147.2 51.2-224 51.2-83.2 0-160-19.2-230.4-51.2-6.4-6.4-25.6-6.4-32 19.2-6.4 12.8 6.4 25.6 12.8 32 76.8 38.4 160 57.6 249.6 57.6s172.8-19.2 243.2-51.2c12.8-12.8 25.6-25.6 19.2-44.8zM832 422.4c-6.4-6.4-12.8-12.8-25.6-12.8h-6.4c-83.2 38.4-179.2 64-275.2 64s-185.6-19.2-268.8-57.6h-6.4c-12.8 0-19.2 6.4-25.6 12.8l-6.4 12.8c0 6.4 6.4 19.2 12.8 19.2 89.6 38.4 192 64 300.8 64 108.8 0 211.2-25.6 300.8-64v-38.4zM185.6 633.6c102.4 44.8 217.6 64 339.2 64 115.2 0 230.4-25.6 332.8-64 12.8-6.4 25.6-19.2 25.6-38.4 0-25.6-19.2-44.8-44.8-44.8h-6.4c-96 38.4-198.4 57.6-307.2 57.6s-211.2-19.2-307.2-51.2h-6.4c-25.6 0-44.8 19.2-44.8 44.8 0 6.4 6.4 25.6 19.2 32zM537.6 76.8c-89.6 0-166.4-44.8-211.2-108.8 57.6-19.2 121.6-32 185.6-32 83.2 0 160 19.2 224 51.2-44.8 57.6-115.2 89.6-198.4 89.6z" />
<glyph unicode="&#xe64b;" d="M979.2 371.2c6.4 25.6 6.4 51.2 6.4 76.8 0 262.4-211.2 473.6-473.6 473.6-25.6 0-51.2 0-76.8-6.4-38.4 32-89.6 44.8-147.2 44.8-160 0-288-128-288-288 0-57.6 12.8-108.8 44.8-153.6-6.4-19.2-6.4-44.8-6.4-70.4 0-262.4 211.2-473.6 473.6-473.6 25.6 0 51.2 0 76.8 6.4 44.8-25.6 96-44.8 153.6-44.8 160 0 288 128 288 288-6.4 57.6-19.2 108.8-51.2 147.2zM736 230.4c-19.2-32-51.2-51.2-89.6-70.4-38.4-19.2-83.2-25.6-134.4-25.6-64 0-115.2 12.8-160 32-32 12.8-51.2 38.4-70.4 64-19.2 32-25.6 57.6-25.6 83.2 0 12.8 6.4 25.6 19.2 38.4 12.8 12.8 25.6 19.2 44.8 19.2 12.8 0 25.6-6.4 38.4-12.8 6.4-6.4 12.8-19.2 19.2-38.4 6.4-19.2 19.2-32 25.6-44.8 6.4-12.8 19.2-25.6 38.4-32 19.2-6.4 38.4-12.8 64-12.8 38.4 0 70.4 6.4 89.6 25.6 25.6 19.2 32 38.4 32 57.6 0 19.2-6.4 32-19.2 44.8-6.4 19.2-19.2 25.6-38.4 32-19.2 6.4-51.2 12.8-83.2 19.2-44.8 12.8-83.2 25.6-115.2 38.4-32 12.8-57.6 32-76.8 51.2-19.2 25.6-25.6 57.6-25.6 89.6 0 32 12.8 64 32 89.6 19.2 25.6 44.8 44.8 83.2 57.6 38.4 12.8 76.8 19.2 128 19.2 38.4 0 70.4-6.4 102.4-12.8 25.6-6.4 51.2-19.2 70.4-38.4 19.2-12.8 32-32 44.8-44.8s12.8-32 12.8-51.2c0-12.8-6.4-25.6-19.2-38.4-12.8-12.8-25.6-19.2-44.8-19.2-12.8 0-25.6 6.4-32 12.8-6.4 6.4-19.2 19.2-25.6 32-12.8 25.6-25.6 38.4-44.8 51.2-12.8 12.8-38.4 19.2-76.8 19.2-32 0-57.6-6.4-76.8-19.2-19.2-12.8-32-25.6-32-44.8 0-12.8 6.4-19.2 12.8-32l25.6-19.2c12.8-6.4 25.6-12.8 38.4-12.8 12.8-6.4 32-6.4 64-12.8 32-12.8 64-25.6 96-32 32-6.4 51.2-19.2 76.8-32 19.2-12.8 38.4-32 51.2-51.2 6.4-25.6 12.8-51.2 12.8-76.8 0-38.4-12.8-70.4-32-102.4z" />
<glyph unicode="&#xe64c;" d="M512 960c-281.6 0-512-230.4-512-512 0-211.2 128-390.4 307.2-467.2 0 38.4 0 76.8 6.4 115.2 12.8 38.4 64 281.6 64 281.6s-12.8 32-12.8 76.8c0 76.8 44.8 134.4 96 134.4s70.4-32 70.4-76.8-32-115.2-44.8-179.2c-12.8-57.6 25.6-96 83.2-96 96 0 160 121.6 160 275.2 0 115.2-76.8 198.4-211.2 198.4-153.6 0-249.6-115.2-249.6-243.2 0-44.8 12.8-76.8 32-102.4 6.4-12.8 12.8-12.8 6.4-25.6 0-6.4-6.4-32-12.8-38.4-6.4-12.8-12.8-19.2-25.6-12.8-70.4 32-102.4 108.8-102.4 198.4 0 147.2 121.6 320 364.8 320 198.4 0 326.4-140.8 326.4-294.4 0-198.4-108.8-352-275.2-352-57.6 0-108.8 32-128 64 0 0-32-115.2-38.4-140.8-12.8-38.4-32-76.8-51.2-108.8 51.2-32 96-38.4 147.2-38.4 281.6 0 512 230.4 512 512s-230.4 512-512 512z" />
<glyph unicode="&#xe64d;" d="M256 915.2c-134.4-51.2-224-147.2-249.6-288-12.8-83.2-6.4-172.8 32-249.6 6.4-19.2 19.2-32 32-51.2l19.2-19.2c12.8 6.4 25.6 6.4 32 12.8 44.8 25.6 76.8 64 115.2 96-128 153.6 6.4 332.8 172.8 377.6 160 38.4 371.2-25.6 416-192 19.2-64 6.4-140.8-44.8-192-25.6-25.6-64-44.8-102.4-51.2-25.6-6.4-44.8-6.4-70.4 0-12.8 6.4-25.6 6.4-38.4 6.4-19.2 6.4-38.4 6.4-38.4 25.6v268.8c0 19.2 0 12.8-12.8 19.2-12.8 0-25.6 0-38.4 6.4-38.4 0-83.2 0-121.6-6.4-12.8 0-19.2 0-19.2-19.2v-140.8l6.4-294.4c0-32 0-102.4-32-115.2-38.4-19.2-70.4 19.2-108.8 25.6 6.4-51.2-25.6-147.2 32-172.8 51.2-25.6 115.2-32 172.8-12.8 115.2 38.4 153.6 172.8 140.8 275.2 179.2-51.2 377.6 38.4 454.4 198.4 57.6 115.2 32 262.4-51.2 358.4-166.4 185.6-480 224-697.6 134.4z" />
<glyph unicode="&#xe64e;" d="M928-64h-832c-51.2 0-96 44.8-96 96v832c0 51.2 44.8 96 96 96h825.6c57.6 0 102.4-44.8 102.4-96v-825.6c0-57.6-44.8-102.4-96-102.4zM262.4 768c-44.8 0-76.8-32-76.8-76.8 0-38.4 25.6-76.8 70.4-76.8 44.8 0 70.4 32 70.4 76.8 6.4 44.8-19.2 76.8-64 76.8zM339.2 569.6h-147.2v-441.6h147.2v441.6zM876.8 377.6c0 134.4-64 204.8-160 204.8-76.8 0-108.8-44.8-128-70.4v64h-153.6v-441.6h147.2v236.8c0 12.8 0 25.6 6.4 32 12.8 25.6 32 51.2 76.8 51.2 51.2 0 70.4-38.4 70.4-96v-230.4h147.2v249.6z" />
<glyph unicode="&#xe64f;" d="M0 89.6v0zM236.8 396.8c89.6 0 153.6 96 140.8 211.2-19.2 121.6-108.8 217.6-198.4 217.6-89.6 6.4-153.6-89.6-140.8-211.2 19.2-115.2 108.8-217.6 198.4-217.6zM1024 704v83.2c0 96-76.8 172.8-166.4 172.8h-684.8c-96 0-172.8-76.8-172.8-166.4 57.6 51.2 140.8 96 224 96h358.4l-83.2-70.4h-108.8c70.4-25.6 115.2-115.2 115.2-204.8 0-76.8-44.8-140.8-102.4-185.6-57.6-44.8-70.4-64-70.4-102.4 0-32 64-89.6 96-108.8 96-64 128-128 128-230.4 0-19.2 0-32-6.4-51.2h307.2c96 0 172.8 76.8 172.8 172.8v531.2h-192v-192h-64v192h-198.4v64h192v192h64v-192h192zM185.6 192h64c-25.6 25.6-51.2 57.6-51.2 96 0 25.6 6.4 44.8 19.2 64h-32c-76.8 6.4-140.8 32-185.6 70.4v-275.2c51.2 32 115.2 44.8 185.6 44.8zM6.4 70.4v19.2c-6.4-6.4-6.4-12.8 0-19.2zM454.4 6.4c-12.8 57.6-70.4 89.6-140.8 140.8-25.6 6.4-57.6 12.8-89.6 12.8-89.6 0-172.8-32-217.6-89.6 12.8-76.8 83.2-134.4 166.4-134.4h288v32c0 12.8 0 25.6-6.4 38.4z" />
<glyph unicode="&#xe650;" d="M512 960c-281.6 0-512-230.4-512-512s230.4-512 512-512 512 230.4 512 512-230.4 512-512 512zM825.6 697.6c51.2-64 83.2-140.8 83.2-230.4-57.6 12.8-115.2 19.2-166.4 19.2-38.4 0-76.8-6.4-115.2-12.8l-25.6 64c83.2 32 160 83.2 224 160zM512 844.8c96 0 179.2-32 249.6-89.6-51.2-64-121.6-108.8-198.4-140.8-51.2 108.8-102.4 179.2-134.4 224 25.6 6.4 51.2 6.4 83.2 6.4zM332.8 806.4c32-32 83.2-102.4 147.2-217.6-121.6-38.4-243.2-44.8-320-44.8h-38.4c32 115.2 108.8 211.2 211.2 262.4zM115.2 448c12.8 6.4 25.6 6.4 44.8 6.4 83.2 0 217.6 6.4 364.8 51.2 6.4-19.2 12.8-32 25.6-51.2-102.4-32-179.2-83.2-230.4-134.4-51.2-51.2-89.6-96-108.8-128-64 70.4-96 160-96 256zM512 51.2c-89.6 0-172.8 32-236.8 76.8 12.8 25.6 44.8 70.4 89.6 115.2 51.2 44.8 115.2 96 204.8 128 32-83.2 57.6-185.6 76.8-294.4-38.4-19.2-83.2-25.6-134.4-25.6zM736 121.6c-19.2 102.4-44.8 185.6-76.8 268.8 25.6 6.4 51.2 6.4 83.2 6.4 44.8 0 102.4-6.4 153.6-19.2-12.8-108.8-70.4-198.4-160-256z" />
<glyph unicode="&#xe651;" d="M921.6 678.4h-256v64h256v-64zM499.2 416c12.8-25.6 25.6-57.6 25.6-96s-6.4-70.4-25.6-102.4l-51.2-51.2c-19.2-12.8-44.8-25.6-70.4-32s-57.6-6.4-89.6-6.4h-288v640h307.2c76.8 0 134.4-25.6 166.4-70.4 19.2-25.6 25.6-57.6 25.6-96s-12.8-70.4-32-96c-6.4-12.8-19.2-25.6-44.8-32 32-12.8 57.6-32 76.8-57.6zM147.2 518.4h134.4c25.6 0 51.2 6.4 70.4 12.8 19.2 12.8 25.6 32 25.6 57.6 0 32-12.8 51.2-32 57.6-25.6 6.4-51.2 12.8-83.2 12.8h-115.2v-140.8zM390.4 332.8c0 32-12.8 57.6-38.4 70.4-12.8 6.4-38.4 12.8-64 12.8h-140.8v-172.8h134.4c25.6 0 51.2 6.4 64 12.8 25.6 6.4 44.8 32 44.8 76.8zM1017.6 435.2c6.4-19.2 6.4-51.2 6.4-89.6h-332.8c0-44.8 19.2-76.8 44.8-96 19.2-12.8 38.4-19.2 64-19.2s51.2 6.4 64 19.2c19.2 6.4 25.6 19.2 32 32h121.6c0-25.6-19.2-57.6-44.8-83.2-38.4-44.8-96-64-172.8-64-57.6 0-115.2 19.2-160 57.6-44.8 32-70.4 96-70.4 179.2 0 76.8 19.2 140.8 64 185.6 44.8 44.8 96 64 166.4 64 38.4 0 76.8-6.4 108.8-19.2 32-12.8 57.6-38.4 76.8-70.4 19.2-32 25.6-64 32-96zM902.4 422.4c0 32-12.8 57.6-32 70.4-19.2 19.2-44.8 25.6-70.4 25.6-32 0-51.2-6.4-70.4-25.6-19.2-19.2-25.6-38.4-32-70.4h204.8z" />
<glyph unicode="&#xe652;" d="M565.888 547.328l69.824-33.728 105.408 33.728v61.184c0 126.080-102.784 228.608-229.12 228.608s-229.056-102.592-229.056-228.608v-321.024c0-29.632-24.192-53.696-53.824-53.696s-53.824 24.064-53.824 53.696v134.4h-175.296v-134.4c0-126.080 102.72-228.608 229.12-228.608 126.336 0 229.12 102.592 229.12 228.608v321.024c0 29.568 24.192 53.696 53.824 53.696 29.696 0 53.888-24.128 53.888-53.696l-0.064-61.184zM848.704 421.888v-134.4c0-29.632-24.128-53.696-53.824-53.696-29.696 0-53.888 24.064-53.888 53.696v137.088l-105.344-33.728-69.824 33.728v-137.088c0-126.080 102.784-228.608 229.12-228.608s229.056 102.592 229.056 228.608v134.4h-175.296z" />
<glyph unicode="&#xe653;" d="M608 307.2c-19.2-19.2 0-51.2 0-51.2l128-217.6s19.2-25.6 38.4-25.6 38.4 12.8 38.4 12.8l102.4 147.2s12.8 19.2 12.8 32c0 25.6-32 32-32 32l-243.2 76.8c-6.4 0-25.6 6.4-44.8-6.4zM595.2 416c12.8-19.2 44.8-12.8 44.8-12.8l243.2 70.4s32 12.8 38.4 32c6.4 19.2-6.4 38.4-6.4 38.4l-108.8 134.4s-12.8 19.2-32 19.2c-25.6 0-38.4-25.6-38.4-25.6l-140.8-217.6s-6.4-19.2 0-38.4zM480 499.2c32 6.4 38.4 51.2 38.4 51.2v345.6c-6.4 0-6.4 38.4-25.6 51.2-32 19.2-44.8 6.4-51.2 6.4l-198.4-70.4s-19.2-6.4-32-25.6c-12.8-25.6 12.8-57.6 12.8-57.6l211.2-288s19.2-19.2 44.8-12.8zM435.2 358.4c0 25.6-32 44.8-32 44.8l-217.6 108.8s-32 12.8-44.8 6.4c-19.2-12.8-25.6-25.6-32-32l-12.8-172.8s0-32 6.4-44.8c12.8-19.2 44.8-6.4 44.8-6.4l256 57.6c12.8 0 25.6 6.4 32 38.4zM492.8 262.4c-19.2 12.8-44.8-6.4-44.8-6.4l-172.8-185.6s-19.2-25.6-12.8-44.8c6.4-19.2 12.8-25.6 25.6-32l172.8-51.2s19.2-6.4 38.4 0c19.2 0 12.8 32 12.8 32l6.4 256s0 25.6-25.6 32z" />
<glyph unicode="&#xe654;" d="M518.4 416l115.2-313.6v-6.4c-38.4-12.8-83.2-19.2-128-19.2-38.4 0-76.8 6.4-108.8 12.8l121.6 326.4zM896 448c0-140.8-76.8-256-192-326.4l115.2 332.8c19.2 51.2 32 96 32 134.4v38.4c32-51.2 44.8-115.2 44.8-179.2zM128 448c0 51.2 12.8 108.8 32 153.6l185.6-486.4c-128 57.6-217.6 185.6-217.6 332.8zM192 652.8c70.4 102.4 185.6 166.4 320 166.4 102.4 0 192-38.4 262.4-96h-6.4c-38.4 0-64-32-64-64s19.2-57.6 38.4-89.6c12.8-25.6 32-57.6 32-102.4 0-32-12.8-70.4-32-121.6l-38.4-128-140.8 403.2c25.6 0 44.8 6.4 44.8 6.4 19.2 0 19.2 32 0 32 0 0-64-6.4-102.4-6.4-38.4 0-102.4 6.4-102.4 6.4-19.2 0-25.6-32 0-32 0 0 19.2 0 38.4-6.4l57.6-160-83.2-243.2-140.8 403.2c25.6 6.4 44.8 6.4 44.8 6.4 19.2 0 19.2 32 0 32 0 0-64-6.4-102.4-6.4h-25.6zM851.2 960h-678.4c-96 0-172.8-76.8-172.8-172.8v-678.4c0-96 76.8-172.8 172.8-172.8h678.4c96 0 172.8 76.8 172.8 172.8v678.4c0 96-76.8 172.8-172.8 172.8zM960 448c0-249.6-198.4-448-448-448s-448 198.4-448 448 198.4 448 448 448 448-198.4 448-448z" />
<glyph unicode="&#xe655;" d="M409.6 62.494v343.341h493.929v-439.718l-493.929 96.376zM409.6 839.529l493.929 90.353v-439.718h-493.929v349.365zM331.294 490.165h-331.294v271.059l331.294 60.235v-331.294zM331.294 80.565l-331.294 66.259v259.012h331.294v-325.271z" horiz-adv-x="904" />
<glyph unicode="&#xe656;" d="M64 768c19.2-128 128-659.2 377.6-812.8 38.4-25.6 83.2-19.2 115.2 6.4 121.6 102.4 243.2 275.2 275.2 358.4 64-6.4 108.8 12.8 108.8 12.8v128h-115.2c-140.8 0-236.8 166.4-179.2 313.6 38.4 102.4 108.8 25.6 121.6 0 12.8-32 6.4-115.2-6.4-172.8 19.2-51.2 140.8-76.8 166.4-38.4 32 96 44.8 262.4-38.4 352-57.6 38.4-198.4 70.4-300.8 6.4s-102.4-204.8-96-275.2c6.4-70.4 32-217.6 172.8-300.8 12.8-12.8-153.6-230.4-160-217.6-185.6 179.2-249.6 544-262.4 640h-179.2z" />
<glyph unicode="&#xe657;" d="M576 512v-236.8c0-57.6 0-96 6.4-108.8 6.4-19.2 19.2-32 38.4-44.8 25.6-12.8 51.2-19.2 76.8-19.2 51.2 0 83.2 6.4 134.4 38.4v-153.6c-44.8-19.2-83.2-32-115.2-38.4-38.4-12.8-76.8-12.8-115.2-12.8-44.8 0-76.8 6.4-108.8 19.2-38.4 12.8-64 32-89.6 51.2-25.6 19.2-44.8 44.8-51.2 70.4-12.8 25.6-12.8 57.6-12.8 108.8v352h-147.2v147.2c38.4 12.8 83.2 32 115.2 57.6 25.6 25.6 51.2 51.2 70.4 89.6 19.2 32 32 76.8 38.4 128h160v-256h256v-192h-256z" />
<glyph unicode="&#xe658;" d="M646.4 236.8h-192l-64-300.8h-262.4l25.6 108.8h-153.6l198.4 915.2h448c134.4 0 288-96 236.8-313.6-38.4-192-192-300.8-371.2-300.8h-185.6l-64-300.8h-44.8l-12.8-44.8h134.4l64 300.8h243.2c76.8 0 147.2 25.6 198.4 64l32 25.6c51.2 51.2 83.2 115.2 102.4 192 12.8 76.8 6.4 140.8-32 185.6-19.2 19.2-38.4 38.4-64 51.2 96-38.4 166.4-134.4 134.4-288-38.4-179.2-192-294.4-371.2-294.4zM492.8 524.8c70.4 0 134.4 57.6 153.6 128 19.2 70.4-25.6 128-89.6 128h-128l-64-256h128z" />
<glyph unicode="&#xe659;" d="M780.8 160c-204.8 0-275.2 89.6-313.6 204.8l-38.4 121.6c-25.6 89.6-64 153.6-166.4 153.6-70.4 0-147.2-51.2-147.2-198.4 0-115.2 57.6-185.6 140.8-185.6 89.6 0 153.6 70.4 153.6 70.4l44.8-102.4s-64-64-198.4-64c-166.4 0-256 96-256 275.2 0 192 89.6 300.8 262.4 300.8 153.6 0 236.8-57.6 281.6-211.2l38.4-121.6c25.6-89.6 76.8-147.2 198.4-147.2 76.8 0 121.6 19.2 121.6 64 0 32-19.2 57.6-76.8 76.8l-76.8 19.2c-96 25.6-134.4 76.8-134.4 153.6 0 128 102.4 172.8 211.2 172.8 121.6 0 192-44.8 204.8-153.6l-115.2-12.8c-6.4 51.2-38.4 70.4-89.6 70.4s-83.2-25.6-83.2-64 12.8-57.6 64-70.4l76.8-19.2c89.6-25.6 140.8-70.4 140.8-166.4 0-121.6-96-166.4-243.2-166.4z" />
<glyph unicode="&#xe65a;" d="M928 960h-832c-51.2 0-96-44.8-96-96v-825.6c0-57.6 44.8-102.4 96-102.4h825.6c57.6 0 96 44.8 96 96v832c6.4 51.2-38.4 96-89.6 96zM512 646.4c108.8 0 198.4-89.6 198.4-198.4s-89.6-198.4-198.4-198.4-198.4 89.6-198.4 198.4 89.6 198.4 198.4 198.4zM896 102.4c0-19.2-19.2-38.4-38.4-38.4h-691.2c-19.2 0-38.4 19.2-38.4 38.4v409.6h89.6c-6.4-25.6-6.4-51.2-6.4-76.8 0-166.4 128-307.2 300.8-307.2s300.8 140.8 300.8 307.2c0 25.6-6.4 51.2-12.8 76.8h96v-409.6zM896 678.4c0-19.2-19.2-38.4-38.4-38.4h-115.2c-19.2 0-38.4 19.2-38.4 38.4v115.2c0 19.2 19.2 38.4 38.4 38.4h115.2c19.2 0 38.4-19.2 38.4-38.4v-115.2z" />
<glyph unicode="&#xe65b;" d="M64 960l64-896 384-128 384 128 64 896h-896zM780.8 659.2h-428.8l12.8-115.2h409.6l-32-352-230.4-64-230.4 64-12.8 179.2h115.2v-89.6l128-32 128 32 12.8 147.2h-390.4l-32 345.6h563.2l-12.8-115.2z" />
<glyph unicode="&#xe65c;" d="M0 435.2c0-44.8 6.4-89.6 12.8-128s19.2-70.4 38.4-96c12.8-25.6 32-51.2 57.6-70.4s51.2-38.4 76.8-51.2c25.6-12.8 57.6-25.6 96-32l108.8-19.2s76.8-6.4 121.6-6.4 83.2 0 121.6 6.4 70.4 6.4 108.8 19.2c38.4 6.4 70.4 19.2 96 32s51.2 32 76.8 51.2c25.6 19.2 44.8 44.8 57.6 70.4 12.8 25.6 25.6 57.6 38.4 96 12.8 38.4 12.8 83.2 12.8 128 0 83.2-25.6 153.6-83.2 217.6l6.4 25.6c0 12.8 6.4 25.6 6.4 44.8v64l-19.2 76.8h-32c-12.8 0-25.6-6.4-44.8-6.4-19.2-6.4-38.4-12.8-64-25.6l-76.8-51.2c-51.2 12.8-121.6 19.2-204.8 19.2s-153.6-6.4-198.4-19.2c-32 19.2-57.6 32-83.2 44.8-25.6 12.8-44.8 19.2-64 25.6l-38.4 12.8h-38.4l-19.2-76.8c-6.4-25.6-6.4-44.8 0-64 0-19.2 6.4-32 6.4-44.8 0-12.8 6.4-19.2 6.4-25.6-57.6-64-83.2-134.4-83.2-217.6zM128 307.2c0 44.8 19.2 89.6 64 134.4 12.8 12.8 25.6 19.2 44.8 25.6 19.2 6.4 38.4 12.8 57.6 12.8h64c19.2 0 44.8 0 76.8-6.4h153.6c25.6 0 51.2 6.4 70.4 6.4h64c19.2 0 44.8-6.4 57.6-12.8 19.2-6.4 32-12.8 44.8-25.6 44.8-38.4 64-83.2 64-134.4 0-25.6-6.4-51.2-12.8-76.8l-25.6-57.6c-12.8-12.8-25.6-25.6-44.8-38.4-19.2-12.8-38.4-19.2-57.6-25.6-19.2-6.4-44.8-12.8-70.4-12.8-32 0-57.6-6.4-76.8-6.4-25.6 6.4-57.6 6.4-89.6 6.4h-89.6c-25.6 0-51.2 0-76.8 6.4-32 0-51.2 6.4-70.4 12.8-19.2 6.4-38.4 12.8-57.6 25.6-25.6 12.8-44.8 19.2-51.2 38.4-12.8 12.8-19.2 32-25.6 57.6-12.8 19.2-12.8 44.8-12.8 70.4zM640 320c0-51.2 25.6-96 64-96s64 44.8 64 96-25.6 96-64 96c-32 0-64-44.8-64-96zM256 320c0-51.2 32-96 64-96s64 44.8 64 96-25.6 96-64 96-64-44.8-64-96z" />
<glyph unicode="&#xe65d;" d="M985.6 364.8l-390.4-390.4c-44.8-44.8-121.6-44.8-166.4 0l-396.8 390.4c-44.8 44.8-44.8 121.6 0 166.4l390.4 390.4c51.2 51.2 128 51.2 172.8 6.4l179.2-179.2-262.4-268.8-102.4 102.4c-32 32-83.2 32-108.8 0l-83.2-83.2c-32-32-32-76.8 0-108.8l236.8-236.8c25.6-25.6 57.6-25.6 83.2-19.2 12.8 6.4 19.2 6.4 25.6 19.2l396.8 403.2 19.2-19.2c57.6-51.2 57.6-128 6.4-172.8zM550.4 224c-12.8-12.8-44.8-12.8-44.8-12.8s-32 0-38.4 12.8l-179.2 185.6c-12.8 12.8-12.8 38.4 0 57.6l51.2 51.2c12.8 12.8 44.8 12.8 57.6 0l115.2-121.6 352 352c12.8 12.8 44.8 12.8 57.6 0l51.2-51.2c12.8-12.8 12.8-44.8 0-57.6l-422.4-416z" />
<glyph unicode="&#xe65e;" d="M512 748.8l211.2 179.2 300.8-198.4-204.8-166.4-307.2 185.6zM1024 396.8l-300.8-198.4-211.2 172.8 300.8 185.6 211.2-160zM300.8 198.4l-300.8 198.4 204.8 166.4 307.2-192-211.2-172.8zM0 729.6l300.8 198.4 211.2-179.2-300.8-192-211.2 172.8zM512 332.8l211.2-179.2 89.6 57.6v-64l-300.8-179.2-300.8 179.2v64l89.6-51.2 211.2 172.8z" />
<glyph unicode="&#xe65f;" d="M864 249.6c-38.4 0-64 32-64 64v256c0 38.4 32 64 64 64 38.4 0 64-32 64-64v-256c0-32-25.6-64-64-64zM697.6 102.4h-38.4v-108.8c0-38.4-25.6-64-57.6-64s-57.6 25.6-57.6 64v108.8h-70.4v-108.8c0-38.4-25.6-64-57.6-64s-57.6 25.6-57.6 64v108.8h-32c-19.2 0-38.4 19.2-38.4 44.8v428.8h448v-422.4c0-32-12.8-51.2-38.4-51.2zM736 633.6h-448c0 89.6 32 153.6 76.8 192l-70.4 83.2c-6.4 12.8-6.4 25.6 0 38.4 12.8 12.8 25.6 12.8 38.4 0l83.2-96c32 12.8 64 19.2 96 19.2s70.4-6.4 96-19.2l83.2 96c12.8 12.8 25.6 12.8 38.4 0s12.8-32 0-38.4l-70.4-83.2c44.8-32 76.8-102.4 76.8-192zM441.6 761.6c-12.8 0-25.6-12.8-25.6-32s12.8-32 25.6-32 25.6 12.8 25.6 32-12.8 32-25.6 32zM582.4 761.6c-12.8 0-25.6-12.8-25.6-32s12.8-32 25.6-32 25.6 19.2 25.6 32-12.8 32-25.6 32zM160 249.6c-38.4 0-64 32-64 64v256c0 38.4 25.6 64 64 64s64-32 64-64v-256c0-32-25.6-64-64-64z" />
<glyph unicode="&#xe660;" d="M921.6 211.2c-32-153.6-115.2-211.2-147.2-249.6-32-25.6-121.6-25.6-153.6-6.4-38.4 25.6-134.4 25.6-166.4 0-44.8-32-115.2-19.2-128-12.8-256 179.2-352 716.8 12.8 774.4 64 12.8 134.4-32 134.4-32 51.2-25.6 70.4-12.8 115.2 6.4 96 44.8 243.2 44.8 313.6-76.8-147.2-96-153.6-294.4 19.2-403.2zM716.8 960c12.8-70.4-64-224-204.8-230.4-12.8 38.4 32 217.6 204.8 230.4z" />
</font></defs></svg>

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

Binary file not shown.

13
docs/waifu_plugin/jquery-ui.min.js vendored Normal file

File diff suppressed because one or more lines are too long

4
docs/waifu_plugin/jquery.min.js vendored Normal file

File diff suppressed because one or more lines are too long

4238
docs/waifu_plugin/live2d.js Normal file

File diff suppressed because it is too large Load Diff

1
docs/waifu_plugin/source Normal file
View File

@@ -0,0 +1 @@
https://github.com/fghrsh/live2d_demo

View File

@@ -0,0 +1,405 @@
window.live2d_settings = Array(); /*
く__,.ヘヽ.    / ,ー、 〉
      ', !-─‐-i / /´
      /`ー'    L//`ヽ、 Live2D 看板娘 参数设置
     /  ,  /|  ,  ,    ', Version 1.4.2
   イ  / /-/  L_ ハ ヽ!  i Update 2018.11.12
    レ ヘ 7イ  レ'ァ-ト、!ハ|  |
     !,/7 '0'   ´0iソ|   |   
     |.从"  _   ,,,, / |./   | 网页添加 Live2D 看板娘
     レ'| i.、,,__ _,.イ /  .i  | https://www.fghrsh.net/post/123.html
      レ'| | / k__/レ'ヽ, ハ. |
       | |/i 〈|/  i ,.ヘ | i | Thanks
      .|/ /    ヘ!   | journey-ad / https://github.com/journey-ad/live2d_src
        kヽ>、ハ   _,.ヘ、   /、! xiazeyu / https://github.com/xiazeyu/live2d-widget.js
       !'〈//´', '7'ーr' Live2d Cubism SDK WebGL 2.1 Projrct & All model authors.
       レ'ヽL__|___i,___,ンレ|
         ト-,/ |___./
         'ー'  !_,.:*********************************************************************************/
// 后端接口
live2d_settings['modelAPI'] = '//live2d.fghrsh.net/api/'; // 自建 API 修改这里
live2d_settings['tipsMessage'] = 'waifu-tips.json'; // 同目录下可省略路径
live2d_settings['hitokotoAPI'] = 'lwl12.com'; // 一言 API可选 'lwl12.com', 'hitokoto.cn', 'jinrishici.com'(古诗词)
// 默认模型
live2d_settings['modelId'] = 1; // 默认模型 ID可在 F12 控制台找到
live2d_settings['modelTexturesId'] = 53; // 默认材质 ID可在 F12 控制台找到
// 工具栏设置
live2d_settings['showToolMenu'] = true; // 显示 工具栏 ,可选 true(真), false(假)
live2d_settings['canCloseLive2d'] = true; // 显示 关闭看板娘 按钮,可选 true(真), false(假)
live2d_settings['canSwitchModel'] = true; // 显示 模型切换 按钮,可选 true(真), false(假)
live2d_settings['canSwitchTextures'] = true; // 显示 材质切换 按钮,可选 true(真), false(假)
live2d_settings['canSwitchHitokoto'] = true; // 显示 一言切换 按钮,可选 true(真), false(假)
live2d_settings['canTakeScreenshot'] = true; // 显示 看板娘截图 按钮,可选 true(真), false(假)
live2d_settings['canTurnToHomePage'] = true; // 显示 返回首页 按钮,可选 true(真), false(假)
live2d_settings['canTurnToAboutPage'] = true; // 显示 跳转关于页 按钮,可选 true(真), false(假)
// 模型切换模式
live2d_settings['modelStorage'] = true; // 记录 ID (刷新后恢复),可选 true(真), false(假)
live2d_settings['modelRandMode'] = 'switch'; // 模型切换,可选 'rand'(随机), 'switch'(顺序)
live2d_settings['modelTexturesRandMode']= 'rand'; // 材质切换,可选 'rand'(随机), 'switch'(顺序)
// 提示消息选项
live2d_settings['showHitokoto'] = true; // 显示一言
live2d_settings['showF12Status'] = true; // 显示加载状态
live2d_settings['showF12Message'] = false; // 显示看板娘消息
live2d_settings['showF12OpenMsg'] = true; // 显示控制台打开提示
live2d_settings['showCopyMessage'] = true; // 显示 复制内容 提示
live2d_settings['showWelcomeMessage'] = true; // 显示进入面页欢迎词
//看板娘样式设置
live2d_settings['waifuSize'] = '280x250'; // 看板娘大小,例如 '280x250', '600x535'
live2d_settings['waifuTipsSize'] = '250x70'; // 提示框大小,例如 '250x70', '570x150'
live2d_settings['waifuFontSize'] = '12px'; // 提示框字体,例如 '12px', '30px'
live2d_settings['waifuToolFont'] = '14px'; // 工具栏字体,例如 '14px', '36px'
live2d_settings['waifuToolLine'] = '20px'; // 工具栏行高,例如 '20px', '36px'
live2d_settings['waifuToolTop'] = '0px' // 工具栏顶部边距,例如 '0px', '-60px'
live2d_settings['waifuMinWidth'] = '768px'; // 面页小于 指定宽度 隐藏看板娘,例如 'disable'(禁用), '768px'
live2d_settings['waifuEdgeSide'] = 'left:0'; // 看板娘贴边方向,例如 'left:0'(靠左 0px), 'right:30'(靠右 30px)
live2d_settings['waifuDraggable'] = 'disable'; // 拖拽样式,例如 'disable'(禁用), 'axis-x'(只能水平拖拽), 'unlimited'(自由拖拽)
live2d_settings['waifuDraggableRevert'] = true; // 松开鼠标还原拖拽位置,可选 true(真), false(假)
// 其他杂项设置
live2d_settings['l2dVersion'] = '1.4.2'; // 当前版本
live2d_settings['l2dVerDate'] = '2018.11.12'; // 版本更新日期
live2d_settings['homePageUrl'] = 'auto'; // 主页地址,可选 'auto'(自动), '{URL 网址}'
live2d_settings['aboutPageUrl'] = 'https://www.fghrsh.net/post/123.html'; // 关于页地址, '{URL 网址}'
live2d_settings['screenshotCaptureName']= 'live2d.png'; // 看板娘截图文件名,例如 'live2d.png'
/****************************************************************************************************/
String.prototype.render = function(context) {
var tokenReg = /(\\)?\{([^\{\}\\]+)(\\)?\}/g;
return this.replace(tokenReg, function (word, slash1, token, slash2) {
if (slash1 || slash2) { return word.replace('\\', ''); }
var variables = token.replace(/\s/g, '').split('.');
var currentObject = context;
var i, length, variable;
for (i = 0, length = variables.length; i < length; ++i) {
variable = variables[i];
currentObject = currentObject[variable];
if (currentObject === undefined || currentObject === null) return '';
}
return currentObject;
});
};
var re = /x/;
console.log(re);
function empty(obj) {return typeof obj=="undefined"||obj==null||obj==""?true:false}
function getRandText(text) {return Array.isArray(text) ? text[Math.floor(Math.random() * text.length + 1)-1] : text}
function showMessage(text, timeout, flag) {
if(flag || sessionStorage.getItem('waifu-text') === '' || sessionStorage.getItem('waifu-text') === null){
if(Array.isArray(text)) text = text[Math.floor(Math.random() * text.length + 1)-1];
if (live2d_settings.showF12Message) console.log('[Message]', text.replace(/<[^<>]+>/g,''));
if(flag) sessionStorage.setItem('waifu-text', text);
$('.waifu-tips').stop();
$('.waifu-tips').html(text).fadeTo(200, 1);
if (timeout === undefined) timeout = 5000;
hideMessage(timeout);
}
}
function hideMessage(timeout) {
$('.waifu-tips').stop().css('opacity',1);
if (timeout === undefined) timeout = 5000;
window.setTimeout(function() {sessionStorage.removeItem('waifu-text')}, timeout);
$('.waifu-tips').delay(timeout).fadeTo(200, 0);
}
function initModel(waifuPath, type) {
/* console welcome message */
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('8.d(" ");8.d("\\U,.\\y\\5.\\1\\1\\1\\1/\\1,\\u\\2 \\H\\n\\1\\1\\1\\1\\1\\b \', !-\\r\\j-i\\1/\\1/\\g\\n\\1\\1\\1 \\1 \\a\\4\\f\'\\1\\1\\1 L/\\a\\4\\5\\2\\n\\1\\1 \\1 /\\1 \\a,\\1 /|\\1 ,\\1 ,\\1\\1\\1 \',\\n\\1\\1\\1\\q \\1/ /-\\j/\\1\\h\\E \\9 \\5!\\1 i\\n\\1\\1\\1 \\3 \\6 7\\q\\4\\c\\1 \\3\'\\s-\\c\\2!\\t|\\1 |\\n\\1\\1\\1\\1 !,/7 \'0\'\\1\\1 \\X\\w| \\1 |\\1\\1\\1\\n\\1\\1\\1\\1 |.\\x\\"\\1\\l\\1\\1 ,,,, / |./ \\1 |\\n\\1\\1\\1\\1 \\3\'| i\\z.\\2,,A\\l,.\\B / \\1.i \\1|\\n\\1\\1\\1\\1\\1 \\3\'| | / C\\D/\\3\'\\5,\\1\\9.\\1|\\n\\1\\1\\1\\1\\1\\1 | |/i \\m|/\\1 i\\1,.\\6 |\\F\\1|\\n\\1\\1\\1\\1\\1\\1.|/ /\\1\\h\\G \\1 \\6!\\1\\1\\b\\1|\\n\\1\\1\\1 \\1 \\1 k\\5>\\2\\9 \\1 o,.\\6\\2 \\1 /\\2!\\n\\1\\1\\1\\1\\1\\1 !\'\\m//\\4\\I\\g\', \\b \\4\'7\'\\J\'\\n\\1\\1\\1\\1\\1\\1 \\3\'\\K|M,p,\\O\\3|\\P\\n\\1\\1\\1\\1\\1 \\1\\1\\1\\c-,/\\1|p./\\n\\1\\1\\1\\1\\1 \\1\\1\\1\'\\f\'\\1\\1!o,.:\\Q \\R\\S\\T v"+e.V+" / W "+e.N);8.d(" ");',60,60,'|u3000|uff64|uff9a|uff40|u30fd|uff8d||console|uff8a|uff0f|uff3c|uff84|log|live2d_settings|uff70|u00b4|uff49||u2010||u3000_|u3008||_|___|uff72|u2500|uff67|u30cf|u30fc||u30bd|u4ece|u30d8|uff1e|__|u30a4|k_|uff17_|u3000L_|u3000i|uff1a|u3009|uff34|uff70r|u30fdL__||___i|l2dVerDate|u30f3|u30ce|nLive2D|u770b|u677f|u5a18|u304f__|l2dVersion|FGHRSH|u00b40i'.split('|'),0,{}));
/* 判断 JQuery */
if (typeof($.ajax) != 'function') typeof(jQuery.ajax) == 'function' ? window.$ = jQuery : console.log('[Error] JQuery is not defined.');
/* 加载看板娘样式 */
live2d_settings.waifuSize = live2d_settings.waifuSize.split('x');
live2d_settings.waifuTipsSize = live2d_settings.waifuTipsSize.split('x');
live2d_settings.waifuEdgeSide = live2d_settings.waifuEdgeSide.split(':');
$("#live2d").attr("width",live2d_settings.waifuSize[0]);
$("#live2d").attr("height",live2d_settings.waifuSize[1]);
$(".waifu-tips").width(live2d_settings.waifuTipsSize[0]);
$(".waifu-tips").height(live2d_settings.waifuTipsSize[1]);
$(".waifu-tips").css("top",live2d_settings.waifuToolTop);
$(".waifu-tips").css("font-size",live2d_settings.waifuFontSize);
$(".waifu-tool").css("font-size",live2d_settings.waifuToolFont);
$(".waifu-tool span").css("line-height",live2d_settings.waifuToolLine);
if (live2d_settings.waifuEdgeSide[0] == 'left') $(".waifu").css("left",live2d_settings.waifuEdgeSide[1]+'px');
else if (live2d_settings.waifuEdgeSide[0] == 'right') $(".waifu").css("right",live2d_settings.waifuEdgeSide[1]+'px');
window.waifuResize = function() { $(window).width() <= Number(live2d_settings.waifuMinWidth.replace('px','')) ? $(".waifu").hide() : $(".waifu").show(); };
if (live2d_settings.waifuMinWidth != 'disable') { waifuResize(); $(window).resize(function() {waifuResize()}); }
try {
if (live2d_settings.waifuDraggable == 'axis-x') $(".waifu").draggable({ axis: "x", revert: live2d_settings.waifuDraggableRevert });
else if (live2d_settings.waifuDraggable == 'unlimited') $(".waifu").draggable({ revert: live2d_settings.waifuDraggableRevert });
else $(".waifu").css("transition", 'all .3s ease-in-out');
} catch(err) { console.log('[Error] JQuery UI is not defined.') }
live2d_settings.homePageUrl = live2d_settings.homePageUrl == 'auto' ? window.location.protocol+'//'+window.location.hostname+'/' : live2d_settings.homePageUrl;
if (window.location.protocol == 'file:' && live2d_settings.modelAPI.substr(0,2) == '//') live2d_settings.modelAPI = 'http:'+live2d_settings.modelAPI;
$('.waifu-tool .fui-home').click(function (){
//window.location = 'https://www.fghrsh.net/';
window.location = live2d_settings.homePageUrl;
});
$('.waifu-tool .fui-info-circle').click(function (){
//window.open('https://imjad.cn/archives/lab/add-dynamic-poster-girl-with-live2d-to-your-blog-02');
window.open(live2d_settings.aboutPageUrl);
});
if (typeof(waifuPath) == "object") loadTipsMessage(waifuPath); else {
$.ajax({
cache: true,
url: waifuPath == '' ? live2d_settings.tipsMessage : (waifuPath.substr(waifuPath.length-15)=='waifu-tips.json'?waifuPath:waifuPath+'waifu-tips.json'),
dataType: "json",
success: function (result){ loadTipsMessage(result); }
});
}
if (!live2d_settings.showToolMenu) $('.waifu-tool').hide();
if (!live2d_settings.canCloseLive2d) $('.waifu-tool .fui-cross').hide();
if (!live2d_settings.canSwitchModel) $('.waifu-tool .fui-eye').hide();
if (!live2d_settings.canSwitchTextures) $('.waifu-tool .fui-user').hide();
if (!live2d_settings.canSwitchHitokoto) $('.waifu-tool .fui-chat').hide();
if (!live2d_settings.canTakeScreenshot) $('.waifu-tool .fui-photo').hide();
if (!live2d_settings.canTurnToHomePage) $('.waifu-tool .fui-home').hide();
if (!live2d_settings.canTurnToAboutPage) $('.waifu-tool .fui-info-circle').hide();
if (waifuPath === undefined) waifuPath = '';
var modelId = localStorage.getItem('modelId');
var modelTexturesId = localStorage.getItem('modelTexturesId');
if (!live2d_settings.modelStorage || modelId == null) {
var modelId = live2d_settings.modelId;
var modelTexturesId = live2d_settings.modelTexturesId;
} loadModel(modelId, modelTexturesId);
}
function loadModel(modelId, modelTexturesId=0) {
if (live2d_settings.modelStorage) {
localStorage.setItem('modelId', modelId);
localStorage.setItem('modelTexturesId', modelTexturesId);
} else {
sessionStorage.setItem('modelId', modelId);
sessionStorage.setItem('modelTexturesId', modelTexturesId);
} loadlive2d('live2d', live2d_settings.modelAPI+'get/?id='+modelId+'-'+modelTexturesId, (live2d_settings.showF12Status ? console.log('[Status]','live2d','模型',modelId+'-'+modelTexturesId,'加载完成'):null));
}
function loadTipsMessage(result) {
window.waifu_tips = result;
$.each(result.mouseover, function (index, tips){
$(document).on("mouseover", tips.selector, function (){
var text = getRandText(tips.text);
text = text.render({text: $(this).text()});
showMessage(text, 3000);
});
});
$.each(result.click, function (index, tips){
$(document).on("click", tips.selector, function (){
var text = getRandText(tips.text);
text = text.render({text: $(this).text()});
showMessage(text, 3000, true);
});
});
$.each(result.seasons, function (index, tips){
var now = new Date();
var after = tips.date.split('-')[0];
var before = tips.date.split('-')[1] || after;
if((after.split('/')[0] <= now.getMonth()+1 && now.getMonth()+1 <= before.split('/')[0]) &&
(after.split('/')[1] <= now.getDate() && now.getDate() <= before.split('/')[1])){
var text = getRandText(tips.text);
text = text.render({year: now.getFullYear()});
showMessage(text, 6000, true);
}
});
if (live2d_settings.showF12OpenMsg) {
re.toString = function() {
showMessage(getRandText(result.waifu.console_open_msg), 5000, true);
return '';
};
}
if (live2d_settings.showCopyMessage) {
$(document).on('copy', function() {
showMessage(getRandText(result.waifu.copy_message), 5000, true);
});
}
$('.waifu-tool .fui-photo').click(function(){
showMessage(getRandText(result.waifu.screenshot_message), 5000, true);
window.Live2D.captureName = live2d_settings.screenshotCaptureName;
window.Live2D.captureFrame = true;
});
$('.waifu-tool .fui-cross').click(function(){
sessionStorage.setItem('waifu-dsiplay', 'none');
showMessage(getRandText(result.waifu.hidden_message), 1300, true);
window.setTimeout(function() {$('.waifu').hide();}, 1300);
});
window.showWelcomeMessage = function(result) {
var text;
if (window.location.href == live2d_settings.homePageUrl) {
var now = (new Date()).getHours();
if (now > 23 || now <= 5) text = getRandText(result.waifu.hour_tips['t23-5']);
else if (now > 5 && now <= 7) text = getRandText(result.waifu.hour_tips['t5-7']);
else if (now > 7 && now <= 11) text = getRandText(result.waifu.hour_tips['t7-11']);
else if (now > 11 && now <= 14) text = getRandText(result.waifu.hour_tips['t11-14']);
else if (now > 14 && now <= 17) text = getRandText(result.waifu.hour_tips['t14-17']);
else if (now > 17 && now <= 19) text = getRandText(result.waifu.hour_tips['t17-19']);
else if (now > 19 && now <= 21) text = getRandText(result.waifu.hour_tips['t19-21']);
else if (now > 21 && now <= 23) text = getRandText(result.waifu.hour_tips['t21-23']);
else text = getRandText(result.waifu.hour_tips.default);
} else {
var referrer_message = result.waifu.referrer_message;
if (document.referrer !== '') {
var referrer = document.createElement('a');
referrer.href = document.referrer;
var domain = referrer.hostname.split('.')[1];
if (window.location.hostname == referrer.hostname)
text = referrer_message.localhost[0] + document.title.split(referrer_message.localhost[2])[0] + referrer_message.localhost[1];
else if (domain == 'baidu')
text = referrer_message.baidu[0] + referrer.search.split('&wd=')[1].split('&')[0] + referrer_message.baidu[1];
else if (domain == 'so')
text = referrer_message.so[0] + referrer.search.split('&q=')[1].split('&')[0] + referrer_message.so[1];
else if (domain == 'google')
text = referrer_message.google[0] + document.title.split(referrer_message.google[2])[0] + referrer_message.google[1];
else {
$.each(result.waifu.referrer_hostname, function(i,val) {if (i==referrer.hostname) referrer.hostname = getRandText(val)});
text = referrer_message.default[0] + referrer.hostname + referrer_message.default[1];
}
} else text = referrer_message.none[0] + document.title.split(referrer_message.none[2])[0] + referrer_message.none[1];
}
showMessage(text, 6000);
}; if (live2d_settings.showWelcomeMessage) showWelcomeMessage(result);
var waifu_tips = result.waifu;
function loadOtherModel() {
var modelId = modelStorageGetItem('modelId');
var modelRandMode = live2d_settings.modelRandMode;
$.ajax({
cache: modelRandMode == 'switch' ? true : false,
url: live2d_settings.modelAPI+modelRandMode+'/?id='+modelId,
dataType: "json",
success: function(result) {
loadModel(result.model['id']);
var message = result.model['message'];
$.each(waifu_tips.model_message, function(i,val) {if (i==result.model['id']) message = getRandText(val)});
showMessage(message, 3000, true);
}
});
}
function loadRandTextures() {
var modelId = modelStorageGetItem('modelId');
var modelTexturesId = modelStorageGetItem('modelTexturesId');
var modelTexturesRandMode = live2d_settings.modelTexturesRandMode;
$.ajax({
cache: modelTexturesRandMode == 'switch' ? true : false,
url: live2d_settings.modelAPI+modelTexturesRandMode+'_textures/?id='+modelId+'-'+modelTexturesId,
dataType: "json",
success: function(result) {
if (result.textures['id'] == 1 && (modelTexturesId == 1 || modelTexturesId == 0))
showMessage(waifu_tips.load_rand_textures[0], 3000, true);
else showMessage(waifu_tips.load_rand_textures[1], 3000, true);
loadModel(modelId, result.textures['id']);
}
});
}
function modelStorageGetItem(key) { return live2d_settings.modelStorage ? localStorage.getItem(key) : sessionStorage.getItem(key); }
/* 检测用户活动状态,并在空闲时显示一言 */
if (live2d_settings.showHitokoto) {
window.getActed = false; window.hitokotoTimer = 0; window.hitokotoInterval = false;
$(document).mousemove(function(e){getActed = true;}).keydown(function(){getActed = true;});
setInterval(function(){ if (!getActed) ifActed(); else elseActed(); }, 1000);
}
function ifActed() {
if (!hitokotoInterval) {
hitokotoInterval = true;
hitokotoTimer = window.setInterval(showHitokotoActed, 30000);
}
}
function elseActed() {
getActed = hitokotoInterval = false;
window.clearInterval(hitokotoTimer);
}
function showHitokotoActed() {
if ($(document)[0].visibilityState == 'visible') showHitokoto();
}
function showHitokoto() {
switch(live2d_settings.hitokotoAPI) {
case 'lwl12.com':
$.getJSON('https://api.lwl12.com/hitokoto/v1?encode=realjson',function(result){
if (!empty(result.source)) {
var text = waifu_tips.hitokoto_api_message['lwl12.com'][0];
if (!empty(result.author)) text += waifu_tips.hitokoto_api_message['lwl12.com'][1];
text = text.render({source: result.source, creator: result.author});
window.setTimeout(function() {showMessage(text+waifu_tips.hitokoto_api_message['lwl12.com'][2], 3000, true);}, 5000);
} showMessage(result.text, 5000, true);
});break;
case 'fghrsh.net':
$.getJSON('https://api.fghrsh.net/hitokoto/rand/?encode=jsc&uid=3335',function(result){
if (!empty(result.source)) {
var text = waifu_tips.hitokoto_api_message['fghrsh.net'][0];
text = text.render({source: result.source, date: result.date});
window.setTimeout(function() {showMessage(text, 3000, true);}, 5000);
showMessage(result.hitokoto, 5000, true);
}
});break;
case 'jinrishici.com':
$.ajax({
url: 'https://v2.jinrishici.com/one.json',
xhrFields: {withCredentials: true},
success: function (result, status) {
if (!empty(result.data.origin.title)) {
var text = waifu_tips.hitokoto_api_message['jinrishici.com'][0];
text = text.render({title: result.data.origin.title, dynasty: result.data.origin.dynasty, author:result.data.origin.author});
window.setTimeout(function() {showMessage(text, 3000, true);}, 5000);
} showMessage(result.data.content, 5000, true);
}
});break;
default:
$.getJSON('https://v1.hitokoto.cn',function(result){
if (!empty(result.from)) {
var text = waifu_tips.hitokoto_api_message['hitokoto.cn'][0];
text = text.render({source: result.from, creator: result.creator});
window.setTimeout(function() {showMessage(text, 3000, true);}, 5000);
}
showMessage(result.hitokoto, 5000, true);
});
}
}
$('.waifu-tool .fui-eye').click(function (){loadOtherModel()});
$('.waifu-tool .fui-user').click(function (){loadRandTextures()});
$('.waifu-tool .fui-chat').click(function (){showHitokoto()});
}

View File

@@ -0,0 +1,116 @@
{
"waifu": {
"console_open_msg": ["哈哈,你打开了控制台,是想要看看我的秘密吗?"],
"copy_message": ["你都复制了些什么呀,转载要记得加上出处哦"],
"screenshot_message": ["照好了嘛,是不是很可爱呢?"],
"hidden_message": ["我们还能再见面的吧…"],
"load_rand_textures": ["我还没有其他衣服呢", "我的新衣服好看嘛"],
"hour_tips": {
"t0-5": ["快睡觉去吧,年纪轻轻小心猝死哦"],
"t5-7": ["早上好!一日之计在于晨,美好的一天就要开始了"],
"t7-11": ["上午好!工作顺利嘛,不要久坐,多起来走动走动哦!"],
"t11-14": ["中午了,工作了一个上午,现在是午餐时间!"],
"t14-17": ["午后很容易犯困呢,今天的运动目标完成了吗?"],
"t17-19": ["傍晚了!窗外夕阳的景色很美丽呢,最美不过夕阳红~"],
"t19-21": ["晚上好,今天过得怎么样?"],
"t21-23": ["已经这么晚了呀,早点休息吧,晚安~"],
"t23-24": ["你是夜猫子呀?这么晚还不睡觉,明天起的来嘛"],
"default": ["嗨~ 快来逗我玩吧!"]
},
"referrer_message": {
"localhost": ["欢迎使用<span style=\"color:rgba(245, 20, 20, 0.62);\">『ChatGPT", "』</span>", " - "],
"baidu": ["Hello! 来自 百度搜索 的朋友<br>你是搜索 <span style=\"color:rgba(245, 20, 20, 0.62);\">", "</span> 找到的我吗?"],
"so": ["Hello! 来自 360搜索 的朋友<br>你是搜索 <span style=\"color:rgba(245, 20, 20, 0.62);\">", "</span> 找到的我吗?"],
"google": ["Hello! 来自 谷歌搜索 的朋友<br>欢迎使用<span style=\"color:rgba(245, 20, 20, 0.62);\">『ChatGPT", "』</span>", " - "],
"default": ["Hello! 来自 <span style=\"color:rgba(245, 20, 20, 0.62);\">", "</span> 的朋友"],
"none": ["欢迎使用<span style=\"color:rgba(245, 20, 20, 0.62);\">『ChatGPT", "』</span>", " - "]
},
"referrer_hostname": {
"example.com": ["示例网站"],
"www.fghrsh.net": ["FGHRSH 的博客"]
},
"model_message": {
"1": ["来自 Potion Maker 的 Pio 酱 ~"],
"2": ["来自 Potion Maker 的 Tia 酱 ~"]
},
"hitokoto_api_message": {
"lwl12.com": ["这句一言来自 <span style=\"color:#0099cc;\">『{source}』</span>", ",是 <span style=\"color:#0099cc;\">{creator}</span> 投稿的", "。"],
"fghrsh.net": ["这句一言出处是 <span style=\"color:#0099cc;\">『{source}』</span>,是 <span style=\"color:#0099cc;\">FGHRSH</span> 在 {date} 收藏的!"],
"jinrishici.com": ["这句诗词出自 <span style=\"color:#0099cc;\">《{title}》</span>,是 {dynasty}诗人 {author} 创作的!"],
"hitokoto.cn": ["这句一言来自 <span style=\"color:#0099cc;\">『{source}』</span>,是 <span style=\"color:#0099cc;\">{creator}</span> 在 hitokoto.cn 投稿的。"]
}
},
"mouseover": [
{ "selector": ".container a[href^='http']", "text": ["要看看 <span style=\"color:#0099cc;\">{text}</span> 么?"] },
{ "selector": ".fui-home", "text": ["点击前往首页,想回到上一页可以使用浏览器的后退功能哦"] },
{ "selector": ".fui-chat", "text": ["一言一语,一颦一笑。一字一句,一颗赛艇。"] },
{ "selector": ".fui-eye", "text": ["嗯··· 要切换 看板娘 吗?"] },
{ "selector": ".fui-user", "text": ["喜欢换装 Play 吗?"] },
{ "selector": ".fui-photo", "text": ["要拍张纪念照片吗?"] },
{ "selector": ".fui-info-circle", "text": ["这里有关于我的信息呢"] },
{ "selector": ".fui-cross", "text": ["你不喜欢我了吗..."] },
{ "selector": "#tor_show", "text": ["翻页比较麻烦吗,点击可以显示这篇文章的目录呢"] },
{ "selector": "#comment_go", "text": ["想要去评论些什么吗?"] },
{ "selector": "#night_mode", "text": ["深夜时要爱护眼睛呀"] },
{ "selector": "#qrcode", "text": ["手机扫一下就能继续看,很方便呢"] },
{ "selector": ".comment_reply", "text": ["要吐槽些什么呢"] },
{ "selector": "#back-to-top", "text": ["回到开始的地方吧"] },
{ "selector": "#author", "text": ["该怎么称呼你呢"] },
{ "selector": "#mail", "text": ["留下你的邮箱,不然就是无头像人士了"] },
{ "selector": "#url", "text": ["你的家在哪里呢,好让我去参观参观"] },
{ "selector": "#textarea", "text": ["认真填写哦,垃圾评论是禁止事项"] },
{ "selector": ".OwO-logo", "text": ["要插入一个表情吗"] },
{ "selector": "#csubmit", "text": ["要[提交]^(Commit)了吗,首次评论需要审核,请耐心等待~"] },
{ "selector": ".ImageBox", "text": ["点击图片可以放大呢"] },
{ "selector": "input[name=s]", "text": ["找不到想看的内容?搜索看看吧"] },
{ "selector": ".previous", "text": ["去上一页看看吧"] },
{ "selector": ".next", "text": ["去下一页看看吧"] },
{ "selector": ".dropdown-toggle", "text": ["这里是菜单"] },
{ "selector": "c-player a.play-icon", "text": ["想要听点音乐吗"] },
{ "selector": "c-player div.time", "text": ["在这里可以调整<span style=\"color:#0099cc;\">播放进度</span>呢"] },
{ "selector": "c-player div.volume", "text": ["在这里可以调整<span style=\"color:#0099cc;\">音量</span>呢"] },
{ "selector": "c-player div.list-button", "text": ["<span style=\"color:#0099cc;\">播放列表</span>里都有什么呢"] },
{ "selector": "c-player div.lyric-button", "text": ["有<span style=\"color:#0099cc;\">歌词</span>的话就能跟着一起唱呢"] },
{ "selector": ".waifu #live2d", "text": [
"别玩了,快去学习!",
"偶尔放松下眼睛吧。",
"看什么看(*^▽^*)",
"焦虑时,吃顿大餐心情就好啦^_^",
"你这个年纪,怎么睡得着觉的你^_^",
"修改ADD_WAIFU=False我就不再打扰你了~",
"经常去github看看我们的更新吧也许有好玩的新功能呢。",
"试试本地大模型吧,有的也很强大的哦。",
"很多强大的函数插件隐藏在下拉菜单中呢。",
"红色的插件,使用之前需要把文件上传进去哦。",
"想添加功能按钮吗读读readme很容易就学会啦。",
"敏感或机密的信息不可以问chatGPT的哦",
"chatGPT究竟是划时代的创新还是扼杀创造力的毒药呢"
] }
],
"click": [
{
"selector": ".waifu #live2d",
"text": [
"是…是不小心碰到了吧",
"萝莉控是什么呀",
"你看到我的小熊了吗",
"再摸的话我可要报警了!⌇●﹏●⌇",
"110吗这里有个变态一直在摸我(ó﹏ò。)"
]
}
],
"seasons": [
{ "date": "01/01", "text": ["<span style=\"color:#0099cc;\">元旦</span>了呢,新的一年又开始了,今年是{year}年~"] },
{ "date": "02/14", "text": ["又是一年<span style=\"color:#0099cc;\">情人节</span>{year}年找到对象了嘛~"] },
{ "date": "03/08", "text": ["今天是<span style=\"color:#0099cc;\">妇女节</span>"] },
{ "date": "03/12", "text": ["今天是<span style=\"color:#0099cc;\">植树节</span>,要保护环境呀"] },
{ "date": "04/01", "text": ["悄悄告诉你一个秘密~<span style=\"background-color:#34495e;\">今天是愚人节,不要被骗了哦~</span>"] },
{ "date": "05/01", "text": ["今天是<span style=\"color:#0099cc;\">五一劳动节</span>,计划好假期去哪里了吗~"] },
{ "date": "06/01", "text": ["<span style=\"color:#0099cc;\">儿童节</span>了呢,快活的时光总是短暂,要是永远长不大该多好啊…"] },
{ "date": "09/03", "text": ["<span style=\"color:#0099cc;\">中国人民抗日战争胜利纪念日</span>,铭记历史、缅怀先烈、珍爱和平、开创未来。"] },
{ "date": "09/10", "text": ["<span style=\"color:#0099cc;\">教师节</span>,在学校要给老师问声好呀~"] },
{ "date": "10/01", "text": ["<span style=\"color:#0099cc;\">国庆节</span>新中国已经成立69年了呢"] },
{ "date": "11/05-11/12", "text": ["今年的<span style=\"color:#0099cc;\">双十一</span>是和谁一起过的呢~"] },
{ "date": "12/20-12/31", "text": ["这几天是<span style=\"color:#0099cc;\">圣诞节</span>,主人肯定又去剁手买买买了~"] }
]
}

290
docs/waifu_plugin/waifu.css Normal file
View File

@@ -0,0 +1,290 @@
.waifu {
position: fixed;
bottom: 0;
z-index: 1;
font-size: 0;
-webkit-transform: translateY(3px);
transform: translateY(3px);
}
.waifu:hover {
-webkit-transform: translateY(0);
transform: translateY(0);
}
.waifu-tips {
opacity: 0;
margin: -20px 20px;
padding: 5px 10px;
border: 1px solid rgba(224, 186, 140, 0.62);
border-radius: 12px;
background-color: rgba(236, 217, 188, 0.5);
box-shadow: 0 3px 15px 2px rgba(191, 158, 118, 0.2);
text-overflow: ellipsis;
overflow: hidden;
position: absolute;
animation-delay: 5s;
animation-duration: 50s;
animation-iteration-count: infinite;
animation-name: shake;
animation-timing-function: ease-in-out;
}
.waifu-tool {
display: none;
color: #aaa;
top: 50px;
right: 10px;
position: absolute;
}
.waifu:hover .waifu-tool {
display: block;
}
.waifu-tool span {
display: block;
cursor: pointer;
color: #5b6c7d;
transition: 0.2s;
}
.waifu-tool span:hover {
color: #34495e;
}
.waifu #live2d{
position: relative;
}
@keyframes shake {
2% {
transform: translate(0.5px, -1.5px) rotate(-0.5deg);
}
4% {
transform: translate(0.5px, 1.5px) rotate(1.5deg);
}
6% {
transform: translate(1.5px, 1.5px) rotate(1.5deg);
}
8% {
transform: translate(2.5px, 1.5px) rotate(0.5deg);
}
10% {
transform: translate(0.5px, 2.5px) rotate(0.5deg);
}
12% {
transform: translate(1.5px, 1.5px) rotate(0.5deg);
}
14% {
transform: translate(0.5px, 0.5px) rotate(0.5deg);
}
16% {
transform: translate(-1.5px, -0.5px) rotate(1.5deg);
}
18% {
transform: translate(0.5px, 0.5px) rotate(1.5deg);
}
20% {
transform: translate(2.5px, 2.5px) rotate(1.5deg);
}
22% {
transform: translate(0.5px, -1.5px) rotate(1.5deg);
}
24% {
transform: translate(-1.5px, 1.5px) rotate(-0.5deg);
}
26% {
transform: translate(1.5px, 0.5px) rotate(1.5deg);
}
28% {
transform: translate(-0.5px, -0.5px) rotate(-0.5deg);
}
30% {
transform: translate(1.5px, -0.5px) rotate(-0.5deg);
}
32% {
transform: translate(2.5px, -1.5px) rotate(1.5deg);
}
34% {
transform: translate(2.5px, 2.5px) rotate(-0.5deg);
}
36% {
transform: translate(0.5px, -1.5px) rotate(0.5deg);
}
38% {
transform: translate(2.5px, -0.5px) rotate(-0.5deg);
}
40% {
transform: translate(-0.5px, 2.5px) rotate(0.5deg);
}
42% {
transform: translate(-1.5px, 2.5px) rotate(0.5deg);
}
44% {
transform: translate(-1.5px, 1.5px) rotate(0.5deg);
}
46% {
transform: translate(1.5px, -0.5px) rotate(-0.5deg);
}
48% {
transform: translate(2.5px, -0.5px) rotate(0.5deg);
}
50% {
transform: translate(-1.5px, 1.5px) rotate(0.5deg);
}
52% {
transform: translate(-0.5px, 1.5px) rotate(0.5deg);
}
54% {
transform: translate(-1.5px, 1.5px) rotate(0.5deg);
}
56% {
transform: translate(0.5px, 2.5px) rotate(1.5deg);
}
58% {
transform: translate(2.5px, 2.5px) rotate(0.5deg);
}
60% {
transform: translate(2.5px, -1.5px) rotate(1.5deg);
}
62% {
transform: translate(-1.5px, 0.5px) rotate(1.5deg);
}
64% {
transform: translate(-1.5px, 1.5px) rotate(1.5deg);
}
66% {
transform: translate(0.5px, 2.5px) rotate(1.5deg);
}
68% {
transform: translate(2.5px, -1.5px) rotate(1.5deg);
}
70% {
transform: translate(2.5px, 2.5px) rotate(0.5deg);
}
72% {
transform: translate(-0.5px, -1.5px) rotate(1.5deg);
}
74% {
transform: translate(-1.5px, 2.5px) rotate(1.5deg);
}
76% {
transform: translate(-1.5px, 2.5px) rotate(1.5deg);
}
78% {
transform: translate(-1.5px, 2.5px) rotate(0.5deg);
}
80% {
transform: translate(-1.5px, 0.5px) rotate(-0.5deg);
}
82% {
transform: translate(-1.5px, 0.5px) rotate(-0.5deg);
}
84% {
transform: translate(-0.5px, 0.5px) rotate(1.5deg);
}
86% {
transform: translate(2.5px, 1.5px) rotate(0.5deg);
}
88% {
transform: translate(-1.5px, 0.5px) rotate(1.5deg);
}
90% {
transform: translate(-1.5px, -0.5px) rotate(-0.5deg);
}
92% {
transform: translate(-1.5px, -1.5px) rotate(1.5deg);
}
94% {
transform: translate(0.5px, 0.5px) rotate(-0.5deg);
}
96% {
transform: translate(2.5px, -0.5px) rotate(-0.5deg);
}
98% {
transform: translate(-1.5px, -1.5px) rotate(-0.5deg);
}
0%, 100% {
transform: translate(0, 0) rotate(0);
}
}
@font-face {
font-family: 'Flat-UI-Icons';
src: url('flat-ui-icons-regular.eot');
src: url('flat-ui-icons-regular.eot?#iefix') format('embedded-opentype'), url('flat-ui-icons-regular.woff') format('woff'), url('flat-ui-icons-regular.ttf') format('truetype'), url('flat-ui-icons-regular.svg#flat-ui-icons-regular') format('svg');
}
[class^="fui-"],
[class*="fui-"] {
font-family: 'Flat-UI-Icons';
speak: none;
font-style: normal;
font-weight: normal;
font-variant: normal;
text-transform: none;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.fui-cross:before {
content: "\e609";
}
.fui-info-circle:before {
content: "\e60f";
}
.fui-photo:before {
content: "\e62a";
}
.fui-eye:before {
content: "\e62c";
}
.fui-chat:before {
content: "\e62d";
}
.fui-home:before {
content: "\e62e";
}
.fui-user:before {
content: "\e631";
}

View File

@@ -186,7 +186,9 @@ def main():
print(f"\t(暗色主题): http://localhost:{PORT}/?__dark-theme=true")
def open():
time.sleep(2) # 打开浏览器
webbrowser.open_new_tab(f"http://localhost:{PORT}/?__dark-theme=true")
DARK_MODE, = get_conf('DARK_MODE')
if DARK_MODE: webbrowser.open_new_tab(f"http://localhost:{PORT}/?__dark-theme=true")
else: webbrowser.open_new_tab(f"http://localhost:{PORT}")
threading.Thread(target=open, name="open-browser", daemon=True).start()
threading.Thread(target=auto_update, name="self-upgrade", daemon=True).start()
threading.Thread(target=warm_up_modules, name="warm-up", daemon=True).start()

View File

@@ -1,6 +1,7 @@
from transformers import AutoModel, AutoTokenizer
import time
import threading
import importlib
from toolbox import update_ui, get_conf
from multiprocessing import Process, Pipe
@@ -18,6 +19,7 @@ class GetGLMHandle(Process):
self.success = True
self.check_dependency()
self.start()
self.threadLock = threading.Lock()
def check_dependency(self):
try:
@@ -72,6 +74,7 @@ class GetGLMHandle(Process):
def stream_chat(self, **kwargs):
# 主进程执行
self.threadLock.acquire()
self.parent.send(kwargs)
while True:
res = self.parent.recv()
@@ -79,7 +82,7 @@ class GetGLMHandle(Process):
yield res
else:
break
return
self.threadLock.release()
global glm_handle
glm_handle = None
@@ -145,10 +148,13 @@ def predict(inputs, llm_kwargs, plugin_kwargs, chatbot, history=[], system_promp
history_feedin.append([history[2*i], history[2*i+1]] )
# 开始接收chatglm的回复
response = "[Local Message]: 等待ChatGLM响应中 ..."
for response in glm_handle.stream_chat(query=inputs, history=history_feedin, max_length=llm_kwargs['max_length'], top_p=llm_kwargs['top_p'], temperature=llm_kwargs['temperature']):
chatbot[-1] = (inputs, response)
yield from update_ui(chatbot=chatbot, history=history)
# 总结输出
if response == "[Local Message]: 等待ChatGLM响应中 ...":
response = "[Local Message]: ChatGLM响应异常 ..."
history.extend([inputs, response])
yield from update_ui(chatbot=chatbot, history=history)

View File

@@ -0,0 +1,153 @@
from transformers import AutoModel, AutoTokenizer
import time
import threading
import importlib
from toolbox import update_ui, get_conf
from multiprocessing import Process, Pipe
load_message = "jittorllms尚未加载加载需要一段时间。注意取决于`config.py`的配置jittorllms消耗大量的内存CPU或显存GPU也许会导致低配计算机卡死 ……"
#################################################################################
class GetGLMHandle(Process):
def __init__(self):
super().__init__(daemon=True)
self.parent, self.child = Pipe()
self.jittorllms_model = None
self.info = ""
self.success = True
self.check_dependency()
self.start()
self.threadLock = threading.Lock()
def check_dependency(self):
try:
import jittor
from .jittorllms.models import get_model
self.info = "依赖检测通过"
self.success = True
except:
self.info = r"缺少jittorllms的依赖如果要使用jittorllms除了基础的pip依赖以外您还需要运行`pip install -r request_llm/requirements_jittorllms.txt`"+\
r"和`git clone https://gitlink.org.cn/jittor/JittorLLMs.git --depth 1 request_llm/jittorllms`两个指令来安装jittorllms的依赖在项目根目录运行这两个指令"
self.success = False
def ready(self):
return self.jittorllms_model is not None
def run(self):
# 子进程执行
# 第一次运行,加载参数
def load_model():
import types
try:
if self.jittorllms_model is None:
device, = get_conf('LOCAL_MODEL_DEVICE')
from .jittorllms.models import get_model
# availabel_models = ["chatglm", "pangualpha", "llama", "chatrwkv"]
args_dict = {'model': 'chatglm', 'RUN_DEVICE':'cpu'}
self.jittorllms_model = get_model(types.SimpleNamespace(**args_dict))
except:
self.child.send('[Local Message] Call jittorllms fail 不能正常加载jittorllms的参数。')
raise RuntimeError("不能正常加载jittorllms的参数")
load_model()
# 进入任务等待状态
while True:
# 进入任务等待状态
kwargs = self.child.recv()
# 收到消息,开始请求
try:
for response, history in self.jittorllms_model.run_web_demo(kwargs['query'], kwargs['history']):
self.child.send(response)
except:
self.child.send('[Local Message] Call jittorllms fail.')
# 请求处理结束,开始下一个循环
self.child.send('[Finish]')
def stream_chat(self, **kwargs):
# 主进程执行
self.threadLock.acquire()
self.parent.send(kwargs)
while True:
res = self.parent.recv()
if res != '[Finish]':
yield res
else:
break
self.threadLock.release()
global glm_handle
glm_handle = None
#################################################################################
def predict_no_ui_long_connection(inputs, llm_kwargs, history=[], sys_prompt="", observe_window=[], console_slience=False):
"""
多线程方法
函数的说明请见 request_llm/bridge_all.py
"""
global glm_handle
if glm_handle is None:
glm_handle = GetGLMHandle()
if len(observe_window) >= 1: observe_window[0] = load_message + "\n\n" + glm_handle.info
if not glm_handle.success:
error = glm_handle.info
glm_handle = None
raise RuntimeError(error)
# jittorllms 没有 sys_prompt 接口因此把prompt加入 history
history_feedin = []
history_feedin.append(["What can I do?", sys_prompt])
for i in range(len(history)//2):
history_feedin.append([history[2*i], history[2*i+1]] )
watch_dog_patience = 5 # 看门狗 (watchdog) 的耐心, 设置5秒即可
response = ""
for response in glm_handle.stream_chat(query=inputs, history=history_feedin, max_length=llm_kwargs['max_length'], top_p=llm_kwargs['top_p'], temperature=llm_kwargs['temperature']):
if len(observe_window) >= 1: observe_window[0] = response
if len(observe_window) >= 2:
if (time.time()-observe_window[1]) > watch_dog_patience:
raise RuntimeError("程序终止。")
return response
def predict(inputs, llm_kwargs, plugin_kwargs, chatbot, history=[], system_prompt='', stream = True, additional_fn=None):
"""
单线程方法
函数的说明请见 request_llm/bridge_all.py
"""
chatbot.append((inputs, ""))
global glm_handle
if glm_handle is None:
glm_handle = GetGLMHandle()
chatbot[-1] = (inputs, load_message + "\n\n" + glm_handle.info)
yield from update_ui(chatbot=chatbot, history=[])
if not glm_handle.success:
glm_handle = None
return
if additional_fn is not None:
import core_functional
importlib.reload(core_functional) # 热更新prompt
core_functional = core_functional.get_core_functions()
if "PreProcess" in core_functional[additional_fn]: inputs = core_functional[additional_fn]["PreProcess"](inputs) # 获取预处理函数(如果有的话)
inputs = core_functional[additional_fn]["Prefix"] + inputs + core_functional[additional_fn]["Suffix"]
# 处理历史信息
history_feedin = []
history_feedin.append(["What can I do?", system_prompt] )
for i in range(len(history)//2):
history_feedin.append([history[2*i], history[2*i+1]] )
# 开始接收jittorllms的回复
response = "[Local Message]: 等待jittorllms响应中 ..."
for response in glm_handle.stream_chat(query=inputs, history=history_feedin, max_length=llm_kwargs['max_length'], top_p=llm_kwargs['top_p'], temperature=llm_kwargs['temperature']):
chatbot[-1] = (inputs, response)
yield from update_ui(chatbot=chatbot, history=history)
# 总结输出
if response == "[Local Message]: 等待jittorllms响应中 ...":
response = "[Local Message]: jittorllms响应异常 ..."
history.extend([inputs, response])
yield from update_ui(chatbot=chatbot, history=history)

View File

@@ -15,6 +15,7 @@ load_message = "等待NewBing响应。"
import time
import json
import re
import logging
import asyncio
import importlib
import threading
@@ -23,15 +24,15 @@ from multiprocessing import Process, Pipe
def preprocess_newbing_out(s):
pattern = r'\^(\d+)\^' # 匹配^数字^
sub = lambda m: '\['+m.group(1)+'\]' # 将匹配到的数字作为替换值
sub = lambda m: '('+m.group(1)+')' # 将匹配到的数字作为替换值
result = re.sub(pattern, sub, s) # 替换操作
if '[1]' in result:
result += '\n\n```\n' + "\n".join([r for r in result.split('\n') if r.startswith('[')]) + '\n```\n'
result += '\n\n```reference\n' + "\n".join([r for r in result.split('\n') if r.startswith('[')]) + '\n```\n'
return result
def preprocess_newbing_out_simple(result):
if '[1]' in result:
result += '\n\n```\n' + "\n".join([r for r in result.split('\n') if r.startswith('[')]) + '\n```\n'
result += '\n\n```reference\n' + "\n".join([r for r in result.split('\n') if r.startswith('[')]) + '\n```\n'
return result
class NewBingHandle(Process):
@@ -247,5 +248,7 @@ def predict(inputs, llm_kwargs, plugin_kwargs, chatbot, history=[], system_promp
yield from update_ui(chatbot=chatbot, history=history, msg="NewBing响应缓慢尚未完成全部响应请耐心完成后再提交新问题。")
if response == "[Local Message]: 等待NewBing响应中 ...": response = "[Local Message]: NewBing响应异常请刷新界面重试 ..."
history.extend([inputs, response])
logging.info(f'[raw_input] {inputs}')
logging.info(f'[response] {response}')
yield from update_ui(chatbot=chatbot, history=history, msg="完成全部响应,请提交新问题。")

View File

@@ -0,0 +1,4 @@
jittor >= 1.3.7.9
jtorch >= 0.1.3
torch
torchvision

26
request_llm/test_llms.py Normal file
View File

@@ -0,0 +1,26 @@
"""
对各个llm模型进行单元测试
"""
def validate_path():
import os, sys
dir_name = os.path.dirname(__file__)
root_dir_assume = os.path.abspath(os.path.dirname(__file__) + '/..')
os.chdir(root_dir_assume)
sys.path.append(root_dir_assume)
validate_path() # validate path so you can run from base directory
from request_llm.bridge_jittorllms import predict_no_ui_long_connection
llm_kwargs = {
'max_length': 512,
'top_p': 1,
'temperature': 1,
}
result = predict_no_ui_long_connection(inputs="你好",
llm_kwargs=llm_kwargs,
history=[],
sys_prompt="")
print('result')

View File

@@ -1,6 +1,6 @@
import gradio as gr
from toolbox import get_conf
CODE_HIGHLIGHT, = get_conf('CODE_HIGHLIGHT')
CODE_HIGHLIGHT, ADD_WAIFU = get_conf('CODE_HIGHLIGHT', 'ADD_WAIFU')
# gradio可用颜色列表
# gr.themes.utils.colors.slate (石板色)
# gr.themes.utils.colors.gray (灰色)
@@ -27,6 +27,7 @@ CODE_HIGHLIGHT, = get_conf('CODE_HIGHLIGHT')
def adjust_theme():
try:
color_er = gr.themes.utils.colors.fuchsia
set_theme = gr.themes.Default(
@@ -80,6 +81,21 @@ def adjust_theme():
button_cancel_text_color=color_er.c600,
button_cancel_text_color_dark="white",
)
# 添加一个萌萌的看板娘
if ADD_WAIFU:
js = """
<script src="file=docs/waifu_plugin/jquery.min.js"></script>
<script src="file=docs/waifu_plugin/jquery-ui.min.js"></script>
<script src="file=docs/waifu_plugin/autoload.js"></script>
"""
gradio_original_template_fn = gr.routes.templates.TemplateResponse
def gradio_new_template_fn(*args, **kwargs):
res = gradio_original_template_fn(*args, **kwargs)
res.body = res.body.replace(b'</html>', f'{js}</html>'.encode("utf8"))
res.init_headers()
return res
gr.routes.templates.TemplateResponse = gradio_new_template_fn # override gradio template
except:
set_theme = None
print('gradio版本较旧, 不能自定义字体和颜色')

View File

@@ -3,6 +3,7 @@ import importlib
import traceback
import inspect
import re
import os
from latex2mathml.converter import convert as tex2mathml
from functools import wraps, lru_cache
@@ -90,8 +91,9 @@ def CatchException(f):
from toolbox import get_conf
proxies, = get_conf('proxies')
tb_str = '```\n' + trimmed_format_exc() + '```'
if chatbot is None or len(chatbot) == 0:
chatbot = [["插件调度异常", "异常原因"]]
if len(chatbot) == 0:
chatbot.clear()
chatbot.append(["插件调度异常", "异常原因"])
chatbot[-1] = (chatbot[-1][0],
f"[Local Message] 实验性函数调用出错: \n\n{tb_str} \n\n当前代理可用性: \n\n{check_proxy(proxies)}")
yield from update_ui(chatbot=chatbot, history=history, msg=f'异常 {e}') # 刷新界面
@@ -216,13 +218,17 @@ def text_divide_paragraph(text):
text = "</br>".join(lines)
return text
@lru_cache(maxsize=128) # 使用 lru缓存 加快转换速度
def markdown_convertion(txt):
"""
将Markdown格式的文本转换为HTML格式。如果包含数学公式则先将公式转换为HTML格式。
"""
pre = '<div class="markdown-body">'
suf = '</div>'
if txt.startswith(pre) and txt.endswith(suf):
# print('警告,输入了已经经过转化的字符串,二次转化可能出问题')
return txt # 已经被转化过,不需要再次转化
markdown_extension_configs = {
'mdx_math': {
'enable_dollar_delimiter': True,
@@ -266,8 +272,14 @@ def markdown_convertion(txt):
content = content.replace('</script>\n</script>', '</script>')
return content
def no_code(txt):
if '```' not in txt:
return True
else:
if '```reference' in txt: return True # newbing
else: return False
if ('$' in txt) and ('```' not in txt): # 有$标识的公式符号,且没有代码段```的标识
if ('$' in txt) and no_code(txt): # 有$标识的公式符号,且没有代码段```的标识
# convert everything to html format
split = markdown.markdown(text='---')
convert_stage_1 = markdown.markdown(text=txt, extensions=['mdx_math', 'fenced_code', 'tables', 'sane_lists'], extension_configs=markdown_extension_configs)
@@ -454,8 +466,9 @@ def on_report_generated(files, chatbot):
return report_files, chatbot
def is_openai_api_key(key):
API_MATCH = re.match(r"sk-[a-zA-Z0-9]{48}$", key)
return bool(API_MATCH)
API_MATCH_ORIGINAL = re.match(r"sk-[a-zA-Z0-9]{48}$", key)
API_MATCH_AZURE = re.match(r"[a-zA-Z0-9]{32}$", key)
return bool(API_MATCH_ORIGINAL) or bool(API_MATCH_AZURE)
def is_api2d_key(key):
if key.startswith('fk') and len(key) == 41:
@@ -505,13 +518,72 @@ def select_api_key(keys, llm_model):
api_key = random.choice(avail_key_list) # 随机负载均衡
return api_key
def read_env_variable(arg, default_value):
"""
环境变量可以是 `GPT_ACADEMIC_CONFIG`(优先),也可以直接是`CONFIG`
例如在windows cmd中既可以写
set USE_PROXY=True
set API_KEY=sk-j7caBpkRoxxxxxxxxxxxxxxxxxxxxxxxxxxxx
set proxies={"http":"http://127.0.0.1:10085", "https":"http://127.0.0.1:10085",}
set AVAIL_LLM_MODELS=["gpt-3.5-turbo", "chatglm"]
set AUTHENTICATION=[("username", "password"), ("username2", "password2")]
也可以写:
set GPT_ACADEMIC_USE_PROXY=True
set GPT_ACADEMIC_API_KEY=sk-j7caBpkRoxxxxxxxxxxxxxxxxxxxxxxxxxxxx
set GPT_ACADEMIC_proxies={"http":"http://127.0.0.1:10085", "https":"http://127.0.0.1:10085",}
set GPT_ACADEMIC_AVAIL_LLM_MODELS=["gpt-3.5-turbo", "chatglm"]
set GPT_ACADEMIC_AUTHENTICATION=[("username", "password"), ("username2", "password2")]
"""
from colorful import print亮红, print亮绿
arg_with_prefix = "GPT_ACADEMIC_" + arg
if arg_with_prefix in os.environ:
env_arg = os.environ[arg_with_prefix]
elif arg in os.environ:
env_arg = os.environ[arg]
else:
raise KeyError
print(f"[ENV_VAR] 尝试加载{arg},默认值:{default_value} --> 修正值:{env_arg}")
try:
if isinstance(default_value, bool):
r = bool(env_arg)
elif isinstance(default_value, int):
r = int(env_arg)
elif isinstance(default_value, float):
r = float(env_arg)
elif isinstance(default_value, str):
r = env_arg.strip()
elif isinstance(default_value, dict):
r = eval(env_arg)
elif isinstance(default_value, list):
r = eval(env_arg)
elif default_value is None:
assert arg == "proxies"
r = eval(env_arg)
else:
print亮红(f"[ENV_VAR] 环境变量{arg}不支持通过环境变量设置! ")
raise KeyError
except:
print亮红(f"[ENV_VAR] 环境变量{arg}加载失败! ")
raise KeyError(f"[ENV_VAR] 环境变量{arg}加载失败! ")
print亮绿(f"[ENV_VAR] 成功读取环境变量{arg}")
return r
@lru_cache(maxsize=128)
def read_single_conf_with_lru_cache(arg):
from colorful import print亮红, print亮绿, print亮蓝
try:
# 优先级1. 获取环境变量作为配置
default_ref = getattr(importlib.import_module('config'), arg) # 读取默认值作为数据类型转换的参考
r = read_env_variable(arg, default_ref)
except:
try:
# 优先级2. 获取config_private中的配置
r = getattr(importlib.import_module('config_private'), arg)
except:
# 优先级3. 获取config中的配置
r = getattr(importlib.import_module('config'), arg)
# 在读取API_KEY时检查一下是不是忘了改config
if arg == 'API_KEY':
print亮蓝(f"[API_KEY] 本项目现已支持OpenAI和API2D的api-key。也支持同时填写多个api-key如API_KEY=\"openai-key1,openai-key2,api2d-key3\"")

View File

@@ -1,5 +1,5 @@
{
"version": 3.3,
"version": 3.32,
"show_feature": true,
"new_feature": "支持NewBing <-> Markdown翻译功能支持直接输入Readme文件网址 <-> 保存对话功能 <-> 解读任意语言代码+同时询问任意的LLM组合 <-> 添加联网Google回答问题插件 <-> 修复ChatGLM上下文BUG <-> 添加支持清华ChatGLM和GPT-4 <-> 改进架构支持与多个LLM模型同时对话 <-> 添加支持API2D国内可支持gpt4"
"new_feature": "完善对话历史的保存/载入/删除 <-> 我们发现了自动更新模块的BUG此次更新可能需要您手动到Github下载新版程序并覆盖 <-> ChatGLM加线程锁提高并发稳定性 <-> 支持NewBing <-> Markdown翻译功能支持直接输入Readme文件网址 <-> 保存对话功能 <-> 解读任意语言代码+同时询问任意的LLM组合 <-> 添加联网Google回答问题插件 <-> 修复ChatGLM上下文BUG <-> 添加支持清华ChatGLM"
}