Skip to content

Commit e69d525

Browse files
authored
Merge pull request #22 from codefuse-ai/release_20240409
Update the modules and adjust the format
2 parents c451405 + 4636fb2 commit e69d525

File tree

7 files changed

+6
-33
lines changed

7 files changed

+6
-33
lines changed

.gitignore

-11
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,6 @@ share/python-wheels/
2727
*.egg
2828
MANIFEST
2929
*.DS_Store
30-
# PyInstaller
31-
# Usually these files are written by a python script from a template
32-
# before PyInstaller builds the exe, so as to inject date/other infos into it.
3330
*.manifest
3431
*.spec
3532

@@ -85,14 +82,6 @@ ipython_config.py
8582
# pyenv
8683
.python-version
8784

88-
# pipenv
89-
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
90-
# However, in case of collaboration, if having platform-specific dependencies or dependencies
91-
# having no cross-platform support, pipenv may install dependencies that don't work, or not
92-
# install all needed dependencies.
93-
#Pipfile.lock
94-
95-
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
9685
__pypackages__/
9786

9887
# Celery stuff

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ res = requests.post(url, headers=headers, json=json.dumps(data))
9999
## Articles
100100
https://mp.weixin.qq.com/s/ExIRu2o7yvXa6nNLZcCfhQ
101101
## modules
102-
![modelcache modules](docs/modelcache_modules_20231114.png)
102+
![modelcache modules](docs/modelcache_modules_20240409.png)
103103
## Function-Comparison
104104
In terms of functionality, we have made several changes to the git repository. Firstly, we have addressed the network issues with huggingface and enhanced the inference speed by introducing local inference capabilities for embeddings. Additionally, considering the limitations of the SqlAlchemy framework, we have completely revamped the module responsible for interacting with relational databases, enabling more flexible database operations. In practical scenarios, LLM products often require integration with multiple users and multiple models. Hence, we have added support for multi-tenancy in the ModelCache, while also making preliminary compatibility adjustments for system commands and multi-turn dialogue.
105105

README_CN.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ res = requests.post(url, headers=headers, json=json.dumps(data))
100100
## 文章
101101
https://mp.weixin.qq.com/s/ExIRu2o7yvXa6nNLZcCfhQ
102102
## 架构大图
103-
![modelcache modules](docs/modelcache_modules_20231114.png)
103+
![modelcache modules](docs/modelcache_modules_20240409.png)
104104
## 功能对比
105105
功能方面,为了解决huggingface网络问题并提升推理速度,增加了embedding本地推理能力。鉴于SqlAlchemy框架存在一些限制,我们对关系数据库交互模块进行了重写,以更灵活地实现数据库操作。在实践中,大型模型产品需要与多个用户和多个模型对接,因此在ModelCache中增加了对多租户的支持,同时也初步兼容了系统指令和多轮会话。
106106

docs/modelcache_modules_20240409.png

494 KB
Loading

flask4modelcache_demo.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -166,4 +166,5 @@ def user_backend():
166166

167167

168168
if __name__ == '__main__':
169-
app.run(host='0.0.0.0', port=5000, debug=True)
169+
# app.run(host='0.0.0.0', port=5000, debug=True)
170+
app.run(host='0.0.0.0', port=5000)

model/text2vec-base-chinese/logs.txt

+1-19
Original file line numberDiff line numberDiff line change
@@ -1,19 +1 @@
1-
Epoch:0 Valid| corr: 0.794410
2-
Epoch:0 Valid| corr: 0.691819
3-
Epoch:1 Valid| corr: 0.722749
4-
Epoch:2 Valid| corr: 0.735054
5-
Epoch:3 Valid| corr: 0.738295
6-
Epoch:4 Valid| corr: 0.739411
7-
Test | corr: 0.679971
8-
Epoch:0 Valid| corr: 0.817416
9-
Epoch:1 Valid| corr: 0.832376
10-
Epoch:2 Valid| corr: 0.842308
11-
Epoch:3 Valid| corr: 0.843520
12-
Epoch:4 Valid| corr: 0.841837
13-
Test | corr: 0.793495
14-
Epoch:0 Valid| corr: 0.814648
15-
Epoch:1 Valid| corr: 0.831609
16-
Epoch:2 Valid| corr: 0.841678
17-
Epoch:3 Valid| corr: 0.842387
18-
Epoch:4 Valid| corr: 0.841435
19-
Test | corr: 0.794840
1+

reference_doc/create_table.sql

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ CREATE TABLE `modelcache_llm_answer` (
1111
PRIMARY KEY(`id`)
1212
) AUTO_INCREMENT = 1 DEFAULT CHARSET = utf8mb4 COMMENT = 'modelcache_llm_answer';
1313

14+
1415
CREATE TABLE `modelcache_query_log` (
1516
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT comment '主键',
1617
`gmt_create` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP comment '创建时间',

0 commit comments

Comments
 (0)