Merge branch 'master' into wps_i18n
合并master
This commit is contained in:
@ -9,12 +9,16 @@ RUN echo '[global]' > /etc/pip.conf && \
|
|||||||
|
|
||||||
|
|
||||||
WORKDIR /gpt
|
WORKDIR /gpt
|
||||||
COPY requirements.txt .
|
|
||||||
|
# 装载项目文件
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
# 安装依赖
|
||||||
RUN pip3 install -r requirements.txt
|
RUN pip3 install -r requirements.txt
|
||||||
|
|
||||||
COPY . .
|
|
||||||
|
|
||||||
# 可选步骤,用于预热模块
|
# 可选步骤,用于预热模块
|
||||||
RUN python3 -c 'from check_proxy import warm_up_modules; warm_up_modules()'
|
RUN python3 -c 'from check_proxy import warm_up_modules; warm_up_modules()'
|
||||||
|
|
||||||
|
# 启动
|
||||||
CMD ["python3", "-u", "main.py"]
|
CMD ["python3", "-u", "main.py"]
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
> **Note**
|
> **Note**
|
||||||
>
|
>
|
||||||
> 安装依赖时,请严格选择requirements.txt中**指定的版本**。
|
> 5月27日对gradio依赖进行了较大的修复和调整,fork并解决了官方Gradio的一系列bug。但如果27日当天进行了更新,可能会导致代码报错(依赖缺失,卡在loading界面等),请及时更新到**最新版代码**并重新安装pip依赖即可。若给您带来困扰还请谅解。安装依赖时,请严格选择requirements.txt中**指定的版本**:
|
||||||
>
|
>
|
||||||
> `pip install -r requirements.txt -i https://mirrors.aliyun.com/pypi/simple/`
|
> `pip install -r requirements.txt -i https://pypi.org/simple`
|
||||||
>
|
>
|
||||||
|
|
||||||
# <img src="docs/logo.png" width="40" > GPT 学术优化 (GPT Academic)
|
# <img src="docs/logo.png" width="40" > GPT 学术优化 (GPT Academic)
|
||||||
@ -302,7 +302,7 @@ gpt_academic开发者QQ群-2:610599535
|
|||||||
|
|
||||||
- 已知问题
|
- 已知问题
|
||||||
- 某些浏览器翻译插件干扰此软件前端的运行
|
- 某些浏览器翻译插件干扰此软件前端的运行
|
||||||
- gradio版本过高或过低,都会导致多种异常
|
- 官方Gradio目前有很多兼容性Bug,请务必使用requirement.txt安装Gradio
|
||||||
|
|
||||||
## 参考与学习
|
## 参考与学习
|
||||||
|
|
||||||
|
|||||||
@ -66,7 +66,7 @@ def 多文件润色(file_manifest, project_folder, llm_kwargs, plugin_kwargs, ch
|
|||||||
with open(fp, 'r', encoding='utf-8', errors='replace') as f:
|
with open(fp, 'r', encoding='utf-8', errors='replace') as f:
|
||||||
file_content = f.read()
|
file_content = f.read()
|
||||||
# 定义注释的正则表达式
|
# 定义注释的正则表达式
|
||||||
comment_pattern = r'%.*'
|
comment_pattern = r'(?<!\\)%.*'
|
||||||
# 使用正则表达式查找注释,并替换为空字符串
|
# 使用正则表达式查找注释,并替换为空字符串
|
||||||
clean_tex_content = re.sub(comment_pattern, '', file_content)
|
clean_tex_content = re.sub(comment_pattern, '', file_content)
|
||||||
# 记录删除注释后的文本
|
# 记录删除注释后的文本
|
||||||
@ -238,5 +238,3 @@ def Latex英文纠错(txt, llm_kwargs, plugin_kwargs, chatbot, history, system_p
|
|||||||
yield from update_ui(chatbot=chatbot, history=history) # 刷新界面
|
yield from update_ui(chatbot=chatbot, history=history) # 刷新界面
|
||||||
return
|
return
|
||||||
yield from 多文件润色(file_manifest, project_folder, llm_kwargs, plugin_kwargs, chatbot, history, system_prompt, language='en', mode='proofread')
|
yield from 多文件润色(file_manifest, project_folder, llm_kwargs, plugin_kwargs, chatbot, history, system_prompt, language='en', mode='proofread')
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -46,7 +46,7 @@ def 多文件翻译(file_manifest, project_folder, llm_kwargs, plugin_kwargs, ch
|
|||||||
with open(fp, 'r', encoding='utf-8', errors='replace') as f:
|
with open(fp, 'r', encoding='utf-8', errors='replace') as f:
|
||||||
file_content = f.read()
|
file_content = f.read()
|
||||||
# 定义注释的正则表达式
|
# 定义注释的正则表达式
|
||||||
comment_pattern = r'%.*'
|
comment_pattern = r'(?<!\\)%.*'
|
||||||
# 使用正则表达式查找注释,并替换为空字符串
|
# 使用正则表达式查找注释,并替换为空字符串
|
||||||
clean_tex_content = re.sub(comment_pattern, '', file_content)
|
clean_tex_content = re.sub(comment_pattern, '', file_content)
|
||||||
# 记录删除注释后的文本
|
# 记录删除注释后的文本
|
||||||
|
|||||||
@ -99,6 +99,7 @@ services:
|
|||||||
command: >
|
command: >
|
||||||
bash -c " echo '[gpt-academic] 正在从github拉取最新代码...' &&
|
bash -c " echo '[gpt-academic] 正在从github拉取最新代码...' &&
|
||||||
git pull &&
|
git pull &&
|
||||||
|
pip install -r requirements.txt &&
|
||||||
echo '[jittorllms] 正在从github拉取最新代码...' &&
|
echo '[jittorllms] 正在从github拉取最新代码...' &&
|
||||||
git --git-dir=request_llm/jittorllms/.git --work-tree=request_llm/jittorllms pull --force &&
|
git --git-dir=request_llm/jittorllms/.git --work-tree=request_llm/jittorllms pull --force &&
|
||||||
python3 -u main.py"
|
python3 -u main.py"
|
||||||
|
|||||||
BIN
docs/gradio-3.32.2-py3-none-any.whl
Normal file
BIN
docs/gradio-3.32.2-py3-none-any.whl
Normal file
Binary file not shown.
9
main.py
9
main.py
@ -2,6 +2,7 @@ import os; os.environ['no_proxy'] = '*' # 避免代理网络产生意外污染
|
|||||||
|
|
||||||
def main():
|
def main():
|
||||||
import gradio as gr
|
import gradio as gr
|
||||||
|
if gr.__version__ not in ['3.28.3','3.32.2']: assert False, "请用 pip install -r requirements.txt 安装依赖"
|
||||||
from request_llm.bridge_all import predict
|
from request_llm.bridge_all import predict
|
||||||
from toolbox import format_io, find_free_port, on_file_uploaded, on_report_generated, get_conf, ArgsGeneralWrapper, DummyWith
|
from toolbox import format_io, find_free_port, on_file_uploaded, on_report_generated, get_conf, ArgsGeneralWrapper, DummyWith
|
||||||
# 建议您复制一个config_private.py放自己的秘密, 如API和代理网址, 避免不小心传github被别人看到
|
# 建议您复制一个config_private.py放自己的秘密, 如API和代理网址, 避免不小心传github被别人看到
|
||||||
@ -196,7 +197,10 @@ def main():
|
|||||||
threading.Thread(target=warm_up_modules, name="warm-up", daemon=True).start()
|
threading.Thread(target=warm_up_modules, name="warm-up", daemon=True).start()
|
||||||
|
|
||||||
auto_opentab_delay()
|
auto_opentab_delay()
|
||||||
demo.queue(concurrency_count=CONCURRENT_COUNT).launch(server_name="0.0.0.0", server_port=PORT, auth=AUTHENTICATION, favicon_path="docs/logo.png")
|
demo.queue(concurrency_count=CONCURRENT_COUNT).launch(
|
||||||
|
server_name="0.0.0.0", server_port=PORT,
|
||||||
|
favicon_path="docs/logo.png", auth=AUTHENTICATION,
|
||||||
|
blocked_paths=["config.py","config_private.py","docker-compose.yml","Dockerfile"])
|
||||||
|
|
||||||
# 如果需要在二级路径下运行
|
# 如果需要在二级路径下运行
|
||||||
# CUSTOM_PATH, = get_conf('CUSTOM_PATH')
|
# CUSTOM_PATH, = get_conf('CUSTOM_PATH')
|
||||||
@ -204,7 +208,8 @@ def main():
|
|||||||
# from toolbox import run_gradio_in_subpath
|
# from toolbox import run_gradio_in_subpath
|
||||||
# run_gradio_in_subpath(demo, auth=AUTHENTICATION, port=PORT, custom_path=CUSTOM_PATH)
|
# run_gradio_in_subpath(demo, auth=AUTHENTICATION, port=PORT, custom_path=CUSTOM_PATH)
|
||||||
# else:
|
# else:
|
||||||
# demo.launch(server_name="0.0.0.0", server_port=PORT, auth=AUTHENTICATION, favicon_path="docs/logo.png")
|
# demo.launch(server_name="0.0.0.0", server_port=PORT, auth=AUTHENTICATION, favicon_path="docs/logo.png",
|
||||||
|
# blocked_paths=["config.py","config_private.py","docker-compose.yml","Dockerfile"])
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
main()
|
main()
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
gradio==3.28.3
|
./docs/gradio-3.32.2-py3-none-any.whl
|
||||||
tiktoken>=0.3.3
|
tiktoken>=0.3.3
|
||||||
requests[socks]
|
requests[socks]
|
||||||
transformers
|
transformers
|
||||||
|
|||||||
4
version
4
version
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"version": 3.36,
|
"version": 3.37,
|
||||||
"show_feature": true,
|
"show_feature": true,
|
||||||
"new_feature": "修复PDF翻译的BUG, 新增HTML中英双栏对照 <-> 添加了OpenAI图片生成插件 <-> 添加了OpenAI音频转文本总结插件 <-> 通过Slack添加对Claude的支持 <-> 提供复旦MOSS模型适配(启用需额外依赖) <-> 提供docker-compose方案兼容LLAMA盘古RWKV等模型的后端 <-> 新增Live2D装饰 <-> 完善对话历史的保存/载入/删除 <-> 保存对话功能"
|
"new_feature": "修复gradio复制按钮BUG <-> 修复PDF翻译的BUG, 新增HTML中英双栏对照 <-> 添加了OpenAI图片生成插件 <-> 添加了OpenAI音频转文本总结插件 <-> 通过Slack添加对Claude的支持 <-> 提供复旦MOSS模型适配(启用需额外依赖) <-> 提供docker-compose方案兼容LLAMA盘古RWKV等模型的后端 <-> 新增Live2D装饰 <-> 完善对话历史的保存/载入/删除 <-> 保存对话功能"
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user