gpt_academic/request_llms
binary-husky c3140ce344
merge frontier branch (#1620)
* Zhipu sdk update 适配最新的智谱SDK,支持GLM4v (#1502)

* 适配 google gemini 优化为从用户input中提取文件

* 适配最新的智谱SDK、支持glm-4v

* requirements.txt fix

* pending history check

---------

Co-authored-by: binary-husky <qingxu.fu@outlook.com>

* Update "生成多种Mermaid图表" plugin: Separate out the file reading function (#1520)

* Update crazy_functional.py with new functionality deal with PDF

* Update crazy_functional.py and Mermaid.py for plugin_kwargs

* Update crazy_functional.py with new chart type: mind map

* Update SELECT_PROMPT and i_say_show_user messages

* Update ArgsReminder message in get_crazy_functions() function

* Update with read md file and update PROMPTS

* Return the PROMPTS as the test found that the initial version worked best

* Update Mermaid chart generation function

* version 3.71

* 解决issues #1510

* Remove unnecessary text from sys_prompt in 解析历史输入 function

* Remove sys_prompt message in 解析历史输入 function

* Update bridge_all.py: supports gpt-4-turbo-preview (#1517)

* Update bridge_all.py: supports gpt-4-turbo-preview

supports gpt-4-turbo-preview

* Update bridge_all.py

---------

Co-authored-by: binary-husky <96192199+binary-husky@users.noreply.github.com>

* Update config.py: supports gpt-4-turbo-preview (#1516)

* Update config.py: supports gpt-4-turbo-preview

supports gpt-4-turbo-preview

* Update config.py

---------

Co-authored-by: binary-husky <96192199+binary-husky@users.noreply.github.com>

* Refactor 解析历史输入 function to handle file input

* Update Mermaid chart generation functionality

* rename files and functions

---------

Co-authored-by: binary-husky <qingxu.fu@outlook.com>
Co-authored-by: hongyi-zhao <hongyi.zhao@gmail.com>
Co-authored-by: binary-husky <96192199+binary-husky@users.noreply.github.com>

* 接入mathpix ocr功能 (#1468)

* Update Latex输出PDF结果.py

借助mathpix实现了PDF翻译中文并重新编译PDF

* Update config.py

add mathpix appid & appkey

* Add 'PDF翻译中文并重新编译PDF' feature to plugins.

---------

Co-authored-by: binary-husky <96192199+binary-husky@users.noreply.github.com>

* fix zhipuai

* check picture

* remove glm-4 due to bug

* 修改config

* 检查MATHPIX_APPID

* Remove unnecessary code and update
function_plugins dictionary

* capture non-standard token overflow

* bug fix #1524

* change mermaid style

* 支持mermaid 滚动放大缩小重置,鼠标滚动和拖拽 (#1530)

* 支持mermaid 滚动放大缩小重置,鼠标滚动和拖拽

* 微调未果 先stage一下

* update

---------

Co-authored-by: binary-husky <qingxu.fu@outlook.com>
Co-authored-by: binary-husky <96192199+binary-husky@users.noreply.github.com>

* ver 3.72

* change live2d

* save the status of ``clear btn` in cookie

* 前端选择保持

* js ui bug fix

* reset btn bug fix

* update live2d tips

* fix missing get_token_num method

* fix live2d toggle switch

* fix persistent custom btn with cookie

* fix zhipuai feedback with core functionality

* Refactor button update and clean up functions

* tailing space removal

* Fix missing MATHPIX_APPID and MATHPIX_APPKEY
configuration

* Prompt fix、脑图提示词优化 (#1537)

* 适配 google gemini 优化为从用户input中提取文件

* 脑图提示词优化

* Fix missing MATHPIX_APPID and MATHPIX_APPKEY
configuration

---------

Co-authored-by: binary-husky <qingxu.fu@outlook.com>

* 优化“PDF翻译中文并重新编译PDF”插件 (#1602)

* Add gemini_endpoint to API_URL_REDIRECT (#1560)

* Add gemini_endpoint to API_URL_REDIRECT

* Update gemini-pro and gemini-pro-vision model_info
endpoints

* Update to support new claude models (#1606)

* Add anthropic library and update claude models

* 更新bridge_claude.py文件,添加了对图片输入的支持。修复了一些bug。

* 添加Claude_3_Models变量以限制图片数量

* Refactor code to improve readability and
maintainability

* minor claude bug fix

* more flexible one-api support

* reformat config

* fix one-api new access bug

* dummy

* compat non-standard api

* version 3.73

---------

Co-authored-by: XIao <46100050+Kilig947@users.noreply.github.com>
Co-authored-by: Menghuan1918 <menghuan2003@outlook.com>
Co-authored-by: hongyi-zhao <hongyi.zhao@gmail.com>
Co-authored-by: Hao Ma <893017927@qq.com>
Co-authored-by: zeyuan huang <599012428@qq.com>
2024-03-11 17:26:09 +08:00
..
README.md re-format code to with pre-commit 2023-12-31 19:30:32 +08:00
bridge_all.py merge frontier branch (#1620) 2024-03-11 17:26:09 +08:00
bridge_chatglm.py merge frontier branch (#1620) 2024-03-11 17:26:09 +08:00
bridge_chatglm3.py merge frontier branch (#1620) 2024-03-11 17:26:09 +08:00
bridge_chatglmft.py merge frontier branch (#1620) 2024-03-11 17:26:09 +08:00
bridge_chatglmonnx.py merge frontier branch (#1620) 2024-03-11 17:26:09 +08:00
bridge_chatgpt.py merge frontier branch (#1620) 2024-03-11 17:26:09 +08:00
bridge_chatgpt_vision.py merge frontier branch (#1620) 2024-03-11 17:26:09 +08:00
bridge_chatgpt_website.py merge frontier branch (#1620) 2024-03-11 17:26:09 +08:00
bridge_claude.py merge frontier branch (#1620) 2024-03-11 17:26:09 +08:00
bridge_deepseekcoder.py merge frontier branch (#1620) 2024-03-11 17:26:09 +08:00
bridge_google_gemini.py merge frontier branch (#1620) 2024-03-11 17:26:09 +08:00
bridge_internlm.py merge frontier branch (#1620) 2024-03-11 17:26:09 +08:00
bridge_jittorllms_llama.py merge frontier branch (#1620) 2024-03-11 17:26:09 +08:00
bridge_jittorllms_pangualpha.py merge frontier branch (#1620) 2024-03-11 17:26:09 +08:00
bridge_jittorllms_rwkv.py merge frontier branch (#1620) 2024-03-11 17:26:09 +08:00
bridge_llama2.py merge frontier branch (#1620) 2024-03-11 17:26:09 +08:00
bridge_moonshot.py Moonshot- 在config.py中增加可用模型 (#1603) 2024-03-05 16:07:05 +08:00
bridge_moss.py merge frontier branch (#1620) 2024-03-11 17:26:09 +08:00
bridge_newbingfree.py format source code 2024-01-13 18:04:09 +08:00
bridge_qianfan.py handle qianfan chat error 2024-02-29 00:36:06 +08:00
bridge_qwen.py Fix response message bug in bridge_qianfan.py, 2024-02-15 00:02:24 +08:00
bridge_qwen_local.py merge frontier branch (#1620) 2024-03-11 17:26:09 +08:00
bridge_skylark2.py Fix response message bug in bridge_qianfan.py, 2024-02-15 00:02:24 +08:00
bridge_spark.py Fix response message bug in bridge_qianfan.py, 2024-02-15 00:02:24 +08:00
bridge_stackclaude.py format source code 2024-01-13 18:04:09 +08:00
bridge_tgui.py merge frontier branch (#1620) 2024-03-11 17:26:09 +08:00
bridge_zhipu.py Merge Frontier, Update to Version 3.72 (#1553) 2024-02-14 18:35:09 +08:00
chatglmoonx.py merge frontier branch (#1620) 2024-03-11 17:26:09 +08:00
com_google.py merge frontier branch (#1620) 2024-03-11 17:26:09 +08:00
com_qwenapi.py change dash scope api key check behavior 2023-12-23 21:35:42 +08:00
com_skylark2api.py 注入火山引擎大模型的接口代码 2024-01-13 22:33:08 +08:00
com_sparkapi.py update spark v3.5, fix glm parallel problem 2024-02-18 14:08:35 +08:00
com_zhipuglm.py merge frontier branch (#1620) 2024-03-11 17:26:09 +08:00
edge_gpt_free.py format source code 2024-01-13 18:04:09 +08:00
key_manager.py merge frontier branch (#1620) 2024-03-11 17:26:09 +08:00
local_llm_class.py merge frontier branch (#1620) 2024-03-11 17:26:09 +08:00
queued_pipe.py 解除本地模型的若干并发问题 2023-10-31 20:37:07 +08:00
requirements_chatglm.txt re-format code to with pre-commit 2023-12-31 19:30:32 +08:00
requirements_chatglm_onnx.txt 修复protobuf版本错误 2023-12-14 11:00:55 +08:00
requirements_jittorllms.txt re-format code to with pre-commit 2023-12-31 19:30:32 +08:00
requirements_moss.txt re-format code to with pre-commit 2023-12-31 19:30:32 +08:00
requirements_newbing.txt rename folder 2023-10-28 17:44:17 +08:00
requirements_qwen.txt re-format code to with pre-commit 2023-12-31 19:30:32 +08:00
requirements_qwen_local.txt re-format code to with pre-commit 2023-12-31 19:30:32 +08:00
requirements_slackclaude.txt re-format code to with pre-commit 2023-12-31 19:30:32 +08:00

README.md

P.S. 如果您按照以下步骤成功接入了新的大模型欢迎发Pull Requests如果您在自己接入新模型的过程中遇到困难欢迎加README底部QQ群联系群主

如何接入其他本地大语言模型

  1. 复制request_llms/bridge_llama2.py,重命名为你喜欢的名字

  2. 修改load_model_and_tokenizer方法加载你的模型和分词器去该模型官网找demo复制粘贴即可

  3. 修改llm_stream_generator方法定义推理模型去该模型官网找demo复制粘贴即可

  4. 命令行测试

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

  6. 修改LLM_MODEL配置,然后运行python main.py,测试最后的效果

如何接入其他在线大语言模型

  1. 复制request_llms/bridge_zhipu.py,重命名为你喜欢的名字

  2. 修改predict_no_ui_long_connection

  3. 修改predict

  4. 命令行测试

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

  6. 修改LLM_MODEL配置,然后运行python main.py,测试最后的效果