liunux4odoo
b3c7f8b072
修复webui中重建知识库以及对话界面UI错误 ( #1615 )
...
* 修复bug:webui点重建知识库时,如果存在不支持的文件会导致整个接口错误;migrate中没有导入CHUNK_SIZE
* 修复:webui对话界面的expander一直为running状态;简化历史消息获取方法
2023-09-28 15:12:03 +08:00
imClumsyPanda
f3042a6a29
merge master
2023-09-22 12:36:45 +08:00
peterz3g
3ff130ecc2
修复csv文件解析编码报错的问题。 ( #1508 )
2023-09-21 14:41:49 +08:00
Jim Zhang
cb2b560a5b
fix : Duplicate variable and function name ( #1509 )
...
Co-authored-by: Jim <zhangpengyi@taijihuabao.com>
2023-09-20 16:46:31 +08:00
Jim Zhang
59fb309ba4
fix : Duplicate variable and function name ( #1509 )
...
Co-authored-by: Jim <zhangpengyi@taijihuabao.com>
2023-09-18 11:00:04 +08:00
glide-the
902ba0c321
增加传入矢量名称加载
2023-09-17 13:56:18 +08:00
liunux4odoo
80375e1ff3
fix merge conflict for #1474 ( #1494 )
2023-09-15 18:11:15 +08:00
liunux4odoo
f7c73b842a
优化configs ( #1474 )
...
* remove llm_model_dict
* optimize configs
* fix get_model_path
* 更改一些默认参数,添加千帆的默认配置
* Update server_config.py.example
2023-09-15 17:52:22 +08:00
imClumsyPanda
20eef45a58
update README.md
2023-09-15 09:53:58 +08:00
zR
769d75d784
修复测试文件 ( #1467 )
...
Co-authored-by: zR <zRzRzRzRzRzRzR>
2023-09-13 17:12:05 +08:00
zR
bfdbe69fa1
增加了自定义分词器适配 ( #1462 )
...
* 添加了自定义分词器适配和测试文件
---------
Co-authored-by: zR <zRzRzRzRzRzRzR>
2023-09-13 15:42:12 +08:00
liunux4odoo
16d8809c9a
api和webui知识库操作支持chunk_size/overlap_size/zh_title_enhance参数 ( #1459 )
2023-09-13 11:19:47 +08:00
liunux4odoo
a03b8d330d
升级到langchain==0.0.287,fschat==0.0.28;处理langchain.Milvus bug( #10492 ) ( #1454 )
...
* 修复milvus_kb_service中一些bug,添加文档后将数据同步到数据库
* 升级到langchain==0.0.287,fschat==0.0.28;处理langchain.Milvus bug(#10492 )
* 修复切换模型BUG: 从在线API切换模型时出错
2023-09-13 08:43:11 +08:00
imClumsyPanda
2020f5bb88
merge master
2023-09-12 15:51:28 +08:00
imClumsyPanda
8064586374
delete .doc from supported formats
2023-09-12 15:22:18 +08:00
liunux4odoo
22ff073309
修改Embeddings和FAISS缓存加载方式,知识库相关API接口支持多线程并发 ( #1434 )
...
* 修改Embeddings和FAISS缓存加载方式,支持多线程,支持内存FAISS
* 知识库相关API接口支持多线程并发
* 根据新的API接口调整ApiRequest和测试用例
* 删除webui.py失效的启动说明
2023-09-11 20:41:41 +08:00
glide-the
5550e3c1a9
增加显示详细日志开关
2023-09-08 20:48:31 +08:00
liunux4odoo
1195eb75eb
merge pr1413
2023-09-08 10:30:07 +08:00
liunux4odoo
661a0e9d72
新功能:
...
- 知识库管理中的add_docs/delete_docs/update_docs均支持批量操作,并利用多线程提高效率
- API的重建知识库接口支持多线程
- add_docs可提供参数控制上传文件后是否继续进行向量化
- add_docs/update_docs支持传入自定义docs(以json形式)。后续考虑区分完整或补充式自定义docs
- download_doc接口添加`preview`参数,支持下载或预览
- kb_service增加`save_vector_store`方法,便于保存向量库(仅FAISS,其它无操作)
- 将document_loader & text_splitter逻辑从KnowledgeFile中抽离出来,为后续对内存文件进行向量化做准备
- KowledgeFile支持docs & splitted_docs的缓存,方便在中间过程做一些自定义
其它:
- 将部分错误输出由print改为logger.error
2023-09-08 08:55:12 +08:00
glide-the
1027ab6c06
增加构建文档metadata检索的开关,移动到dev_metadata_search
2023-09-05 20:59:57 +08:00
glide-the
491c9605d9
增加构建文档metadata检索的开关
2023-09-05 18:35:11 +08:00
liunux4odoo
93b133f9ac
将KnowledgeFile的file2text拆分成file2docs、docs2texts和file2text三个部分,在保持接口不变的情况下,实现:
...
1、支持chunk_size和chunk_overlap参数
2、支持自定义text_splitter
3、支持自定义docs
修复:csv文件不使用text_splitter
2023-09-04 21:00:16 +08:00
imClumsyPanda
d6dce95682
bug fix
2023-09-01 14:15:13 +08:00
imClumsyPanda
6c4ef26e9a
add RapidOCRPDFLoader and RapidOCRLoader ( #1275 )
...
* add RapidOCRPDFLoader
* update mypdfloader.py and requirements.txt
* add myimgloader.py
* add test samples
* add TODO to mypdfloader
* add loaders to KnowledgeFile class
* add loaders to KnowledgeFile class
2023-09-01 10:23:57 +08:00
liunux4odoo
3acbf4d5d1
增加数据库字段,重建知识库使用多线程 ( #1280 )
...
* close #1172 : 给webui_page/utils添加一些log信息,方便定位错误
* 修复:重建知识库时页面未实时显示进度
* skip model_worker running when using online model api such as chatgpt
* 修改知识库管理相关内容:
1.KnowledgeFileModel增加3个字段:file_mtime(文件修改时间),file_size(文件大小),custom_docs(是否使用自定义docs)。为后面比对上传文件做准备。
2.给所有String字段加上长度,防止mysql建表错误(pr#1177)
3.统一[faiss/milvus/pgvector]_kb_service.add_doc接口,使其支持自定义docs
4.为faiss_kb_service增加一些方法,便于调用
5.为KnowledgeFile增加一些方法,便于获取文件信息,缓存file2text的结果。
* 修复/chat/fastchat无法流式输出的问题
* 新增功能:
1、KnowledgeFileModel增加"docs_count"字段,代表该文件加载到向量库中的Document数量,并在WEBUI中进行展示。
2、重建知识库`python init_database.py --recreate-vs`支持多线程。
其它:
统一代码中知识库相关函数用词:file代表一个文件名称或路径,doc代表langchain加载后的Document。部分与API接口有关或含义重叠的函数暂未修改。
---------
Co-authored-by: liunux4odoo <liunux@qq.com>, hongkong9771
2023-08-28 13:50:35 +08:00
imClumsyPanda
8faafa6a32
update format
2023-08-27 20:23:07 +08:00
liunux4odoo
9ca53fa3ad
fix #1224 : failed to load json and pdf files ( #1252 )
...
Co-authored-by: liunux4odoo <liunu@qq.com>
2023-08-26 14:21:59 +08:00
imClumsyPanda
f95d41ef47
[BUG] 修复csv文件读取后,单行数据被分成多段。
2023-08-26 11:45:01 +08:00
zR
7291e77978
support for bge-large-zh-noinstruct and openai text-embedding-ada-002 ( #1119 )
...
* support for bge-large-zh-noinstruct and openai text-embedding-ada-002
* 完善了readme,修改了BGE模型的载入方式
* 补充了readme中bge-large-zh-noinstruct的信息
* Update faiss_kb_service.py
* Update utils.py
---------
Co-authored-by: zR <zRzRzRzRzRzRzR>
Co-authored-by: imClumsyPanda <littlepanda0716@gmail.com>
2023-08-23 22:55:53 +08:00
xain
6d1ea9bc99
Update utils.py ( #1128 )
...
不区分文件扩展名的大小写。
2023-08-17 21:09:05 +08:00
liunux4odoo
a47240e871
fix KnowledgeFile: set text_splitter_name in database to SpacyTextSplitter if it is not set
2023-08-16 10:14:47 +08:00
liunux4odoo
a08fe994c2
更新API与ApiReuest:
...
1. 重新整理webui_pages/utils与server/knowledge_base间的工具依赖
2.
将delete_knowledge_base与delete_doc接口从delete改为post.delete不支持body参数
3. 修复update_doc
4. 修复部分bug
2023-08-11 08:45:26 +08:00
imClumsyPanda
ef098111dc
update webui and utils
2023-08-10 23:04:05 +08:00
imClumsyPanda
8a4d9168fa
update import pkgs and format
2023-08-10 21:26:05 +08:00
imClumsyPanda
8df00d0b04
add SCORE_THRESHOLD to faiss and milvus kb service
2023-08-10 00:36:59 +08:00
imClumsyPanda
02b9d57072
update textsplitter and pdfloader
2023-08-09 23:36:43 +08:00
imClumsyPanda
24a280ce8c
re-add zh_title_enhance.py
2023-08-09 23:09:24 +08:00
imClumsyPanda
1b70fb5f9b
update faiss_kb_service.py
2023-08-09 22:57:36 +08:00
liunux4odoo
c7b91bfaf1
update api/kb_doc_api and knowledge base management ui:
...
1. add update_doc to api which can udpate vector store from existed
content file
2. add parameter `delete_content` to delete_doc api. user can decide
whether delete local content file when delete doc.
3. fix bug in ApiReqeust.upload_doc
4. support listing docs existed in local folder bu not in db
2023-08-09 16:52:04 +08:00
liunux4odoo
2b0f8caa62
improve recreate_vector_store:
...
1. allow empty knowledge base
2. skip unspported files instead of exception
2023-08-08 17:59:41 +08:00
liunux4odoo
e918244159
move KBServiceFactory to server.knowledge_base.kb_service.base
2023-08-08 17:41:58 +08:00
liunux4odoo
c4a3995310
move commonto tools from kbservice.base to server.knowledge_base.utils
2023-08-08 16:40:18 +08:00
liunux4odoo
584e3a9234
remove server/knowledge_base/knowledge_base_factory.py
2023-08-08 16:21:00 +08:00
liunux4odoo
0746272525
remove server/knowledge_base/knowledge_base.py
2023-08-08 13:36:20 +08:00
imClumsyPanda
18d31f5116
add KBService and KBServiceFactory class
2023-08-06 23:44:02 +08:00
imClumsyPanda
b91d96ab0c
update kb_doc_api.py
2023-08-06 18:32:10 +08:00
imClumsyPanda
7e1472a95b
add KnowledgeBase class
2023-08-05 00:10:10 +08:00
imClumsyPanda
590367a5b5
add KnowledgeFile class
2023-08-04 23:54:26 +08:00
imClumsyPanda
775d46fecf
format update in knowledge_base/utils.py
2023-08-04 23:14:43 +08:00
imClumsyPanda
b4f80ca370
update server.knowledge_base.utils
2023-08-04 15:32:42 +08:00