Commit Graph

74 Commits

Author SHA1 Message Date
liunux4odoo ba8d0f8e17
发版:v0.2.5 (#1620)
* 优化configs (#1474)

* remove llm_model_dict

* optimize configs

* fix get_model_path

* 更改一些默认参数,添加千帆的默认配置

* Update server_config.py.example

* fix merge conflict for #1474 (#1494)

* 修复ChatGPT api_base_url错误;用户可以在model_config在线模型配置中覆盖默认的api_base_url (#1496)

* 优化LLM模型列表获取、切换的逻辑: (#1497)

1、更准确的获取未运行的可用模型
2、优化WEBUI模型列表显示与切换的控制逻辑

* 更新migrate.py和init_database.py,加强知识库迁移工具: (#1498)

1. 添加--update-in-db参数,按照数据库信息,从本地文件更新向量库
2. 添加--increament参数,根据本地文件增量更新向量库
3. 添加--prune-db参数,删除本地文件后,自动清理相关的向量库
4. 添加--prune-folder参数,根据数据库信息,清理无用的本地文件
5. 取消--update-info-only参数。数据库中存储了向量库信息,该操作意义不大
6. 添加--kb-name参数,所有操作支持指定操作的知识库,不指定则为所有本地知识库
7. 添加知识库迁移的测试用例
8. 删除milvus_kb_service的save_vector_store方法

* feat: support volc fangzhou

* 使火山方舟正常工作,添加错误处理和测试用例

* feat: support volc fangzhou (#1501)

* feat: support volc fangzhou

---------

Co-authored-by: liunux4odoo <41217877+liunux4odoo@users.noreply.github.com>
Co-authored-by: liqiankun.1111 <liqiankun.1111@bytedance.com>

* 第一版初步agent实现 (#1503)

* 第一版初步agent实现

* 增加steaming参数

* 修改了weather.py

---------

Co-authored-by: zR <zRzRzRzRzRzRzR>

* 添加configs/prompt_config.py,允许用户自定义prompt模板: (#1504)

1、 默认包含2个模板,分别用于LLM对话,知识库和搜索引擎对话
2、 server/utils.py提供函数get_prompt_template,获取指定的prompt模板内容(支持热加载)
3、 api.py中chat/knowledge_base_chat/search_engine_chat接口支持prompt_name参数

* 增加其它模型的参数适配

* 增加传入矢量名称加载

* 1. 搜索引擎问答支持历史记录;
2. 修复知识库问答历史记录传参错误:用户输入被传入history,问题出在webui中重复获取历史消息,api知识库对话接口并无问题。

* langchain日志开关

* move wrap_done & get_ChatOpenAI from server.chat.utils to server.utils (#1506)

* 修复faiss_pool知识库缓存key错误 (#1507)

* fix ReadMe anchor link (#1500)

* fix : Duplicate variable and function name (#1509)

Co-authored-by: Jim <zhangpengyi@taijihuabao.com>

* Update README.md

* fix #1519: streamlit-chatbox旧版BUG,但新版有兼容问题,先在webui中作处理,并限定chatbox版本 (#1525)

close #1519

* 【功能新增】在线 LLM 模型支持阿里云通义千问 (#1534)

* feat: add qwen-api

* 使Qwen API支持temperature参数;添加测试用例

* 将online-api的sdk列为可选依赖

---------

Co-authored-by: liunux4odoo <liunux@qq.com>

* 处理序列化至磁盘的逻辑

* remove depends on volcengine

* update kb_doc_api: use Form instead of Body when upload file

* 将所有httpx请求改为使用Client,提高效率,方便以后设置代理等。 (#1554)

将所有httpx请求改为使用Client,提高效率,方便以后设置代理等。

将本项目相关服务加入无代理列表,避免fastchat的服务器请求错误。(windows下无效)

* update QR code

* update readme_en,readme,requirements_api,requirements,model_config.py.example:测试baichuan2-7b;更新相关文档

* 新增特性:1.支持vllm推理加速框架;2. 更新支持模型列表

* 更新文件:1. startup,model_config.py.example,serve_config.py.example,FAQ

* 1. debug vllm加速框架完毕;2. 修改requirements,requirements_api对vllm的依赖;3.注释掉serve_config中baichuan-7b的device为cpu的配置

* 1. 更新congif中关于vllm后端相关说明;2. 更新requirements,requirements_api;

* 增加了仅限GPT4的agent功能,陆续补充,中文版readme已写 (#1611)

* Dev (#1613)

* 增加了仅限GPT4的agent功能,陆续补充,中文版readme已写

* issue提到的一个bug

* 温度最小改成0,但是不应该支持负数

* 修改了最小的温度

* fix: set vllm based on platform to avoid error on windows

* fix: langchain warnings for import from root

* 修复webui中重建知识库以及对话界面UI错误 (#1615)

* 修复bug:webui点重建知识库时,如果存在不支持的文件会导致整个接口错误;migrate中没有导入CHUNK_SIZE

* 修复:webui对话界面的expander一直为running状态;简化历史消息获取方法

* 根据官方文档,添加对英文版的bge embedding的指示模板 (#1585)

Co-authored-by: zR <2448370773@qq.com>

* Dev (#1618)

* 增加了仅限GPT4的agent功能,陆续补充,中文版readme已写

* issue提到的一个bug

* 温度最小改成0,但是不应该支持负数

* 修改了最小的温度

* 增加了部分Agent支持和修改了启动文件的部分bug

* 修改了GPU数量配置文件

* 1

1

* 修复配置文件错误

* 更新readme,稳定测试

* 更改readme 0928 (#1619)

* 增加了仅限GPT4的agent功能,陆续补充,中文版readme已写

* issue提到的一个bug

* 温度最小改成0,但是不应该支持负数

* 修改了最小的温度

* 增加了部分Agent支持和修改了启动文件的部分bug

* 修改了GPU数量配置文件

* 1

1

* 修复配置文件错误

* 更新readme,稳定测试

* 更新readme

* fix readme

* 处理序列化至磁盘的逻辑

* update version number to v0.2.5

---------

Co-authored-by: qiankunli <qiankun.li@qq.com>
Co-authored-by: liqiankun.1111 <liqiankun.1111@bytedance.com>
Co-authored-by: zR <2448370773@qq.com>
Co-authored-by: glide-the <2533736852@qq.com>
Co-authored-by: Water Zheng <1499383852@qq.com>
Co-authored-by: Jim Zhang <dividi_z@163.com>
Co-authored-by: Jim <zhangpengyi@taijihuabao.com>
Co-authored-by: imClumsyPanda <littlepanda0716@gmail.com>
Co-authored-by: Leego <leegodev@hotmail.com>
Co-authored-by: hzg0601 <hzg0601@163.com>
Co-authored-by: WilliamChen-luckbob <58684828+WilliamChen-luckbob@users.noreply.github.com>
2023-09-28 23:30:21 +08:00
imClumsyPanda 8a4d9168fa update import pkgs and format 2023-08-10 21:26:05 +08:00
imClumsyPanda 717ddf4d10 add history to chat apis 2023-08-08 23:56:27 +08:00
imClumsyPanda dcf49a59ef v0.2.0 first commit 2023-07-27 23:22:07 +08:00
liunux@home dd3617fcdf 将paddle相关loader改为动态引入,可以在不上传pdf/image知识文件的前提下使用protobuf=4.x。
这样可以使用最新版streamlit和chainlit。
2023-07-20 12:32:37 +08:00
imClumsyPanda 33b978b5c4 update README.md 2023-07-17 21:39:10 +08:00
glide-the c5bc21781c 修改模型生成的调用方式,兼容Chain调用
修改模型切换的bug
2023-07-12 23:09:28 +08:00
Zhi-guo Huang 64f22a9e53
修改默认的多卡部署方案,基本保证针对新模型也不会失败 (#788)
* 修复 bing_search.py的typo;更新model_config.py中Bing Subscription Key申请方式及注意事项

* 更新FAQ,增加了[Errno 110] Connection timed out的原因与解决方案

* 修改loader.py中load_in_8bit失败的原因和详细解决方案

* update loader.py

* stream_chat_bing

* 修改stream_chat的接口,在请求体中选择knowledge_base_id;增加stream_chat_bing接口

* 优化cli_demo.py的逻辑:支持 输入提示;多输入;重新输入

* update cli_demo.py

* 按照review建议进行修改

* 修改默认的多卡部署方案,基本保证针对新模型也不会失败

---------

Co-authored-by: imClumsyPanda <littlepanda0716@gmail.com>
2023-07-11 20:24:49 +08:00
Zhi-guo Huang a5ca4bf26a
1.增加对llama-cpp模型的支持;2.增加对bloom/chatyuan/baichuan模型的支持;3. 修复多GPU部署的bug;4. 修复了moss_llm.py的bug;5. 增加对openai支持(没有api,未测试);6. 支持在多卡情况自定义设备GPU (#664)
* 修复 bing_search.py的typo;更新model_config.py中Bing Subscription Key申请方式及注意事项

* 更新FAQ,增加了[Errno 110] Connection timed out的原因与解决方案

* 修改loader.py中load_in_8bit失败的原因和详细解决方案

* update loader.py

* stream_chat_bing

* 修改stream_chat的接口,在请求体中选择knowledge_base_id;增加stream_chat_bing接口

* 优化cli_demo.py的逻辑:支持 输入提示;多输入;重新输入

* update cli_demo.py

* add bloom-3b,bloom-7b1,ggml-vicuna-13b-1.1

* 1.增加对llama-cpp模型的支持;2.增加对bloom模型的支持;3. 修复多GPU部署的bug;4. 增加对openai支持(没有api,未测试);5.增加了llama-cpp模型部署的说明

* llama模型兼容性说明

* modified:   ../configs/model_config.py
	modified:   ../docs/INSTALL.md
在install.md里增加对llama-cpp模型调用的说明

* 修改llama_llm.py以适应llama-cpp模型

* 完成llama-cpp模型的支持;

* make fastchat and openapi compatiable

* 1. 修复/增加对chatyuan,bloom,baichuan-7等模型的支持;2. 修复了moss_llm.py的bug;

* set default model be chatglm-6b

* 在多卡情况下也支持自定义GPU设备

---------

Co-authored-by: imClumsyPanda <littlepanda0716@gmail.com>
2023-07-11 19:36:50 +08:00
Zhi-guo Huang c52308d605
1. 修改stream_chat的接口,在请求体中选择knowledge_base_id;2. 增加stream_chat_bing接口;3. 增加了调用流式接口的方法说明;4. 优化cli_demo.py的逻辑:支持 输入提示;多输入;重新输入 (#630)
* 修复 bing_search.py的typo;更新model_config.py中Bing Subscription Key申请方式及注意事项

* 更新FAQ,增加了[Errno 110] Connection timed out的原因与解决方案

* 修改loader.py中load_in_8bit失败的原因和详细解决方案

* update loader.py

* stream_chat_bing

* 修改stream_chat的接口,在请求体中选择knowledge_base_id;增加stream_chat_bing接口

* 优化cli_demo.py的逻辑:支持 输入提示;多输入;重新输入

* update cli_demo.py

* 按照review建议进行修改
2023-07-02 21:54:12 +08:00
kiddog99 25b46a7b9e
标题增强 (#631)
* Add files via upload

* Update local_doc_qa.py

* Update model_config.py

* Update zh_title_enhance.py

* Add files via upload

* Update README.md

* fix bugs in MyFAISS.delete_doc

* fix:前端知识库获取失败.

* update zh_title_enhance.py

* update zh_title_enhance.py

* Update zh_title_enhance.py

* add test/textsplitter

* add test_zh_title_enhance.py

---------

Co-authored-by: imClumsyPanda <littlepanda0716@gmail.com>
Co-authored-by: JZF <jiangzhifeng_jzf@163.com>
Co-authored-by: fxjhello <127916299+fxjhello@users.noreply.github.com>
2023-06-18 21:45:06 +08:00
imClumsyPanda ed7c54858a add delete knowledge base and delete files from knowledge base to webui 2023-06-15 00:21:41 +08:00
imClumsyPanda 11dd2b5b84 update api.py 2023-06-14 00:35:33 +08:00
imClumsyPanda a887df1715 add knowledge_base folder and move vector_store and content inside 2023-06-13 23:54:29 +08:00
imClumsyPanda 7863e0fea8 updata MyFAISS 2023-06-12 00:06:06 +08:00
imClumsyPanda f1f742ce44 add self-defined class MyFAISS 2023-06-07 23:18:47 +08:00
imClumsyPanda 8b7c2e417c add support for csv file 2023-06-07 22:14:08 +08:00
shrimp 57b4f9306d
修复BUG (#570)
一、修复模型历史记录仅一条问题,修改了模型加载代码,已修复。 
二、修复模型历史记录仅一条问题,修改了webui有一个地方有问题,已修复。
三、知识库单条数据入库因知识库名称缓存问题导致的BUG,也已修复。
2023-06-07 18:12:51 +08:00
imClumsyPanda b1ba2003be update webui.py 2023-05-31 20:55:45 +08:00
liunux4odoo 88fee48d8c
use lru_cache to optimize loading of local vector store (#496)
* Add files via upload

* Update README.md

* use lru_cache to optimize loading of local vector store

---------

Co-authored-by: imClumsyPanda <littlepanda0716@gmail.com>
Co-authored-by: liunux <liunux@office>
2023-05-30 23:05:39 +08:00
Ding Junyao f7e120fe56
add tree func for reading files in dirs (#471) 2023-05-27 22:00:43 +08:00
glide-the 5f010823aa Build an abstract dialogue model using classes and methods to represent different dialogue elements
Fixes # None

Before submitting
If you want to review, please refer to the quick start example provided in langchain/chains/dialogue_answering/main.py. You may need to set the openaikey and the following startup parameters: --dialogue-path: the location of the dialogue file, --embedding-model: the HuggingFaceEmbeddings model to use (defaults to GanymedeNil/text2vec-large-chinese) if not specified.

Regarding the format of the dialogue file, please refer to the following information:

```text
sun:
Has the offline model been run?

glide-the:
Yes, it has been run, but the results are not very satisfactory.

glide-the:
It lacks chat intelligence and falls far behind in terms of logic and reasoning.

sun:
Are you available for voice chat?

glide-the:
I'm considering using this offline model: https://huggingface.co/chat

glide-the:
voice chat okay.

glide-the:
You can take a look at the dev_agent branch of the langchain-chatglm project.

glide-the:
There's a dialogue model question-answering example under the agent.

sun:
Alright.

glide-the:
The specified chat record file is exported from WeChat.
```
2023-05-26 01:49:07 +08:00
glide-the c4ee36b8ac 删除 AnswerResultStream 、generate_with_callback收集器 2023-05-25 21:07:40 +08:00
imClumsyPanda bca32cae83 update local_doc_qa.py 2023-05-22 18:09:23 +08:00
imClumsyPanda c79058f064
更新 local_doc_qa.py 2023-05-22 13:14:23 +08:00
yawudede 4634a578f4
local_doc_qa.py 2023-05-22 10:39:55 +08:00
yawudede 9140a5e70c
local_doc_qa.py 2023-05-22 10:36:41 +08:00
yawudede 037b5e4502
local_doc_qa.py
添加精排
2023-05-22 10:32:58 +08:00
imClumsyPanda e352a04cbb merge master 2023-05-22 00:18:48 +08:00
imClumsyPanda 9c422cc6bc update bing_search.py 2023-05-21 22:08:38 +08:00
imClumsyPanda 2681728329 update local_doc_qa.py 2023-05-20 01:54:08 +08:00
imClumsyPanda e8a37ff4c7 update loader.py 2023-05-20 01:24:35 +08:00
zhenkaivip 9f5d1afc31
fix bug : 1、历史最后一条丢失;2、上下两行连读造成歧义 (#415)
* fix _call bug

* fix

* fix bug : 上下两行连读造成歧义
2023-05-20 01:19:22 +08:00
glide-the 33bbb4779e llm_model_dict 处理了loader的一些预设行为,如加载位置,模型名称,模型处理器实例, 定义checkpoint名称和远程路径
loader.py: 模型重载
定义 generatorAnswer 增加 AnswerResultStream
   定义generate_with_callback收集器,在每次响应时将队列数据同步到AnswerResult
requirements.txt 变更项目依赖
2023-05-18 22:54:41 +08:00
imClumsyPanda 621a0fe686 update cli_demo.py 2023-05-13 11:45:57 +08:00
zhenkaivip dd93837343
使用paddleocr实现 (#342)
* jpg and png ocr

* fix

* write docs to tmp file

* fix

* [BUGFIX] local_doc_qa.py line 172: logging have no end args. (#323)

* image loader

* fix

* fix

* update api.py

* update api.py

* update api.py

* update README.md

* update api.py

* add pdf_loader

* fix

---------

Co-authored-by: RainGather <3255329+RainGather@users.noreply.github.com>
Co-authored-by: imClumsyPanda <littlepanda0716@gmail.com>
2023-05-13 08:45:17 +08:00
Tyler Luan 64406cee45
Add MOSS (#317)
* Add MOSS

* Update local_doc_qa.py

---------

Co-authored-by: imClumsyPanda <littlepanda0716@gmail.com>
2023-05-11 18:42:19 +08:00
imClumsyPanda 5852b4c62e update pdf read strategy 2023-05-11 10:54:45 +08:00
imClumsyPanda fbdc62d910 merge master 2023-05-10 17:59:28 +08:00
shrimp 55504fcd4d
新增加知识库测试能力 (#302) 2023-05-10 17:18:20 +08:00
JohnSaxon 466bfb7a3f
logger bug introduced by https://github.com/imClumsyPanda/langchain-ChatGLM/pull/268 , fixed #295 (#297) 2023-05-10 13:28:44 +08:00
imClumsyPanda c613c41d0e update local_doc_qa.py 2023-05-08 23:49:57 +08:00
imClumsyPanda e2d7452c7b update chinese_text_splitter.py 2023-05-06 23:26:49 +08:00
keenzhu 2c72a00954
Update local_doc_qa.py
增加命令行导入的进度条显示
增加文本提示
2023-05-06 18:39:58 +08:00
shrimp 14d998b8e6
可选择lora权重加载 (#231)
* Add files via upload

增加lora权重使用

* Update model_config.py

* Add files via upload

修复一个小错误,少写了模型加载

* 使用lora微调的权重

使用lora微调的权重

* Update model_config.py
2023-05-04 21:01:55 +08:00
Winter 47922d2ee3
fix: 扩展文档的代码逻辑 (#227)
* fix: 扩展文档的代码逻辑

* Update local_doc_qa.py

---------

Co-authored-by: imClumsyPanda <littlepanda0716@gmail.com>
2023-05-04 20:58:15 +08:00
imClumsyPanda 07ff81a119 update torch_gc 2023-05-04 20:48:36 +08:00
imClumsyPanda 2c1fd2bdd5 add api.py 2023-05-03 22:31:28 +08:00
imClumsyPanda a4e67a67b4 update local_doc_qa.py 2023-05-02 01:11:05 +08:00
imClumsyPanda 4df9d76f8a add streaming option in configs/model_config.py 2023-05-01 23:52:28 +08:00