Skip to content

Commit 10c9b06

Browse files
committed
update readme
1 parent 3b40fa4 commit 10c9b06

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed

README.md

+17
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ ModelCache
2424
- [Dependencies](#dependencies)
2525
- [Start service](#start-service)
2626
- [Start demo](#start-demo)
27+
- [Service Startup With Docker-compose](#service-startup-with-docker-compose)
2728
- [Start normal service](#start-normal-service)
2829
- [Visit the service](#visit-the-service)
2930
- [Write cache](#write-cache)
@@ -87,7 +88,23 @@ You can find the start script in `flask4modelcache.py` and `flask4modelcache_dem
8788
```shell
8889
python flask4modelcache_demo.py
8990
```
91+
#### Service Startup With Docker-compose
92+
1. Download the embedding model bin file from [Hugging Face](https://huggingface.co/shibing624/text2vec-base-chinese/tree/main). Place it in the `model/text2vec-base-chinese` folder.
93+
2. Configure docker network, only need to execute once
94+
```shell
95+
cd CodeFuse-ModelCache
96+
```
97+
```shell
98+
docker network create modelcache
99+
```
100+
3. Execute the docker-compose command
101+
```shell
102+
# When the modelcache image does not exist locally for the first time, or when the Dockerfile is changed
103+
docker-compose up --build
90104

105+
# This is not the first run and the Dockerfile has not changed
106+
docker-compose up
107+
```
91108
#### Start normal service
92109

93110
Before you start standard service, do these steps:

README_CN.md

+20
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ ModelCache
2424
- [环境依赖](#环境依赖)
2525
- [启动服务](#启动服务)
2626
- [启动 Demo](#启动-demo)
27+
- [通过 docker-compose 启动服务](#通过-docker-compose-启动服务)
2728
- [启动标准服务](#启动标准服务)
2829
- [服务访问](#服务访问)
2930
- [写入 cache](#写入-cache)
@@ -89,6 +90,25 @@ Codefuse-ModelCache 是一个开源的大模型语义缓存系统,通过缓存
8990
python flask4modelcache_demo.py
9091
```
9192

93+
#### 通过 docker-compose 启动服务
94+
- 离线模型 bin 文件下载, 参考地址:[Hugging Face](https://huggingface.co/shibing624/text2vec-base-chinese/tree/main),并将下载的 bin 文件,放到 `model/text2vec-base-chinese` 文件夹中。
95+
96+
- 配置 docker network,只需执行一次
97+
```shell
98+
cd CodeFuse-ModelCache
99+
```
100+
```shell
101+
docker network create modelcache
102+
```
103+
- 执行 docker-compose 命令
104+
```shell
105+
# 首次运行本地不存在 modelcache 镜像、或 Dockerfile 变更时
106+
docker-compose up --build
107+
108+
# 非首次运行,且 Dockerfile 无变更
109+
docker-compose up
110+
```
111+
92112
#### 启动标准服务
93113

94114
在启动标准服务前,应该进行如下环境配置:

0 commit comments

Comments
 (0)