Skip to content

Commit

Permalink
Merge pull request #22 from codefuse-ai/release_20240409
Browse files Browse the repository at this point in the history
Update the modules and adjust the format
  • Loading branch information
peng3307165 authored Apr 9, 2024
2 parents c451405 + 4636fb2 commit e69d525
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 33 deletions.
11 changes: 0 additions & 11 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ share/python-wheels/
*.egg
MANIFEST
*.DS_Store
# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

Expand Down Expand Up @@ -85,14 +82,6 @@ ipython_config.py
# pyenv
.python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ res = requests.post(url, headers=headers, json=json.dumps(data))
## Articles
https://mp.weixin.qq.com/s/ExIRu2o7yvXa6nNLZcCfhQ
## modules
![modelcache modules](docs/modelcache_modules_20231114.png)
![modelcache modules](docs/modelcache_modules_20240409.png)
## Function-Comparison
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.

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

Expand Down
Binary file added docs/modelcache_modules_20240409.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion flask4modelcache_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,4 +166,5 @@ def user_backend():


if __name__ == '__main__':
app.run(host='0.0.0.0', port=5000, debug=True)
# app.run(host='0.0.0.0', port=5000, debug=True)
app.run(host='0.0.0.0', port=5000)
20 changes: 1 addition & 19 deletions model/text2vec-base-chinese/logs.txt
Original file line number Diff line number Diff line change
@@ -1,19 +1 @@
Epoch:0 Valid| corr: 0.794410
Epoch:0 Valid| corr: 0.691819
Epoch:1 Valid| corr: 0.722749
Epoch:2 Valid| corr: 0.735054
Epoch:3 Valid| corr: 0.738295
Epoch:4 Valid| corr: 0.739411
Test | corr: 0.679971
Epoch:0 Valid| corr: 0.817416
Epoch:1 Valid| corr: 0.832376
Epoch:2 Valid| corr: 0.842308
Epoch:3 Valid| corr: 0.843520
Epoch:4 Valid| corr: 0.841837
Test | corr: 0.793495
Epoch:0 Valid| corr: 0.814648
Epoch:1 Valid| corr: 0.831609
Epoch:2 Valid| corr: 0.841678
Epoch:3 Valid| corr: 0.842387
Epoch:4 Valid| corr: 0.841435
Test | corr: 0.794840

1 change: 1 addition & 0 deletions reference_doc/create_table.sql
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ CREATE TABLE `modelcache_llm_answer` (
PRIMARY KEY(`id`)
) AUTO_INCREMENT = 1 DEFAULT CHARSET = utf8mb4 COMMENT = 'modelcache_llm_answer';


CREATE TABLE `modelcache_query_log` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT comment '主键',
`gmt_create` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP comment '创建时间',
Expand Down

0 comments on commit e69d525

Please sign in to comment.