serving.md 1.99 KB
Newer Older
lvhan028's avatar
lvhan028 committed
1
2
3
4
# Serving a model

## Serving [LLaMA](https://github.com/facebookresearch/llama)

q.yao's avatar
q.yao committed
5
Weights for the LLaMA models can be obtained from by filling out [this form](https://docs.google.com/forms/d/e/1FAIpQLSfqNECQnMkycAp2jP4Z9TFX0cGR4uf7b_fBxjY_OjhJILlKGA/viewform)
lvhan028's avatar
lvhan028 committed
6
7
8
9
10

<details open>
<summary><b>7B</b></summary>

```shell
del-zhenwu's avatar
del-zhenwu committed
11
python3 -m lmdeploy.serve.turbomind.deploy llama-7B /path/to/llama-7b llama \
lvhan028's avatar
lvhan028 committed
12
13
14
15
16
17
18
19
20
21
    --tokenizer_path /path/to/tokenizer/model
bash workspace/service_docker_up.sh
```

</details>

<details open>
<summary><b>13B</b></summary>

```shell
del-zhenwu's avatar
del-zhenwu committed
22
python3 -m lmdeploy.serve.turbomind.deploy llama-13B /path/to/llama-13b llama \
lvhan028's avatar
lvhan028 committed
23
24
25
26
27
28
29
30
31
32
    --tokenizer_path /path/to/tokenizer/model --tp 2
bash workspace/service_docker_up.sh
```

</details>

<details open>
<summary><b>30B</b></summary>

```shell
del-zhenwu's avatar
del-zhenwu committed
33
python3 -m lmdeploy.serve.turbomind.deploy llama-32B /path/to/llama-30b llama \
lvhan028's avatar
lvhan028 committed
34
35
36
37
38
39
40
41
42
43
    --tokenizer_path /path/to/tokenizer/model --tp 4
bash workspace/service_docker_up.sh
```

</details>

<details open>
<summary><b>65B</b></summary>

```shell
del-zhenwu's avatar
del-zhenwu committed
44
python3 -m lmdeploy.serve.turbomind.deploy llama-65B /path/to/llama-65b llama \
lvhan028's avatar
lvhan028 committed
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
    --tokenizer_path /path/to/tokenizer/model --tp 8
bash workspace/service_docker_up.sh
```

</details>

### Serving [Vicuna](https://lmsys.org/blog/2023-03-30-vicuna/)

<details open>
<summary><b>7B</b></summary>

```shell
python3 -m pip install fschat
python3 -m fastchat.model.apply_delta \
  --base-model-path /path/to/llama-7b \
  --target-model-path /path/to/vicuna-7b \
  --delta-path lmsys/vicuna-7b-delta-v1.1

python3 lmdeploy/serve/turbomind/deploy.py vicuna-7B /path/to/vicuna-7b hf
bash workspace/service_docker_up.sh
```

</details>

<details open>
<summary><b>13B</b></summary>

```shell
python3 -m pip install fschat
python3 -m fastchat.model.apply_delta \
  --base-model-path /path/to/llama-13b \
  --target-model-path /path/to/vicuna-13b \
  --delta-path lmsys/vicuna-13b-delta-v1.1

python3 lmdeploy/serve/turbomind/deploy.py vicuna-13B /path/to/vicuna-13b hf
bash workspace/service_docker_up.sh
```

</details>