* logging sys to loguru: stage 1 complete * import loguru: stage 2 * logging -> loguru: stage 3 * support o1-preview and o1-mini * logging -> loguru stage 4 * update social helper * logging -> loguru: final stage * fix: console output * update translation matrix * fix: loguru argument error with proxy enabled (#1977) * relax llama index version * remove comment * Added some modules to support openrouter (#1975) * Added some modules for supporting openrouter model Added some modules for supporting openrouter model * Update config.py * Update .gitignore * Update bridge_openrouter.py * Not changed actually * Refactor logging in bridge_openrouter.py --------- Co-authored-by: binary-husky <qingxu.fu@outlook.com> * remove logging extra --------- Co-authored-by: Steven Moder <java20131114@gmail.com> Co-authored-by: Ren Lifei <2602264455@qq.com>
P.S. 如果您按照以下步骤成功接入了新的大模型,欢迎发Pull Requests(如果您在自己接入新模型的过程中遇到困难,欢迎加README底部QQ群联系群主)
如何接入其他本地大语言模型
-
复制
request_llms/bridge_llama2.py,重命名为你喜欢的名字 -
修改
load_model_and_tokenizer方法,加载你的模型和分词器(去该模型官网找demo,复制粘贴即可) -
修改
llm_stream_generator方法,定义推理模型(去该模型官网找demo,复制粘贴即可) -
命令行测试
- 修改
tests/test_llms.py(聪慧如您,只需要看一眼该文件就明白怎么修改了) - 运行
python tests/test_llms.py
- 修改
-
测试通过后,在
request_llms/bridge_all.py中做最后的修改,把你的模型完全接入到框架中(聪慧如您,只需要看一眼该文件就明白怎么修改了) -
修改
LLM_MODEL配置,然后运行python main.py,测试最后的效果
如何接入其他在线大语言模型
-
复制
request_llms/bridge_zhipu.py,重命名为你喜欢的名字 -
修改
predict_no_ui_long_connection -
修改
predict -
命令行测试
- 修改
tests/test_llms.py(聪慧如您,只需要看一眼该文件就明白怎么修改了) - 运行
python tests/test_llms.py
- 修改
-
测试通过后,在
request_llms/bridge_all.py中做最后的修改,把你的模型完全接入到框架中(聪慧如您,只需要看一眼该文件就明白怎么修改了) -
修改
LLM_MODEL配置,然后运行python main.py,测试最后的效果