Commit ad5d2f04 authored by laibao's avatar laibao
Browse files

Update README.md

parent 434b8d08
......@@ -95,7 +95,7 @@ python examples/offline_inference.py
1、指定输入输出
```bash
python benchmarks/benchmark_throughput.py --num-prompts 1 --input-len 32 --output-len 128 --model internlm/internlm2.5-7b -tp 1 --trust-remote-code --enforce-eager --dtype float16
python benchmarks/benchmark_throughput.py --num-prompts 1 --input-len 32 --output-len 128 --model internlm/internlm2_5-7b -tp 1 --trust-remote-code --enforce-eager --dtype float16
```
其中 `--num-prompts`是batch数,`--input-len`是输入seqlen,`--output-len`是输出token长度,`--model`为模型路径,`-tp`为使用卡数,`dtype="float16"`为推理数据类型,如果模型权重是bfloat16,需要修改为float16推理。若指定 `--output-len 1`即为首字延迟。`-q gptq`为使用gptq量化模型进行推理。
......@@ -108,7 +108,7 @@ wget http://113.200.138.88:18080/aidatasets/anon8231489123/ShareGPT_Vicuna_unfil
```
```bash
python benchmarks/benchmark_throughput.py --num-prompts 1 --model internlm/internlm2.5-7b --dataset ShareGPT_V3_unfiltered_cleaned_split.json -tp 1 --trust-remote-code --enforce-eager --dtype float16
python benchmarks/benchmark_throughput.py --num-prompts 1 --model internlm/internlm2_5-7b --dataset ShareGPT_V3_unfiltered_cleaned_split.json -tp 1 --trust-remote-code --enforce-eager --dtype float16
```
其中 `--num-prompts`是batch数,`--model`为模型路径,`--dataset`为使用的数据集,`-tp`为使用卡数,`dtype="float16"`为推理数据类型,如果模型权重是bfloat16,需要修改为float16推理。`-q gptq`为使用gptq量化模型进行推理。
......@@ -118,13 +118,13 @@ python benchmarks/benchmark_throughput.py --num-prompts 1 --model internlm/inter
1.启动服务:
```bash
python -m vllm.entrypoints.openai.api_server --model internlm/internlm2.5-7b --enforce-eager --dtype float16 --trust-remote-code
python -m vllm.entrypoints.openai.api_server --model internlm/internlm2_5-7b --enforce-eager --dtype float16 --trust-remote-code
```
2.启动客户端
```
python benchmarks/benchmark_serving.py --model internlm/internlm2.5-7b --dataset ShareGPT_V3_unfiltered_cleaned_split.json --num-prompts 1 --trust-remote-code
python benchmarks/benchmark_serving.py --model internlm/internlm2_5-7b --dataset ShareGPT_V3_unfiltered_cleaned_split.json --num-prompts 1 --trust-remote-code
```
参数同使用数据集,离线批量推理性能测试,具体参考[benchmarks/benchmark_serving.py](/codes/modelzoo/qwen1.5_vllm/-/blob/master/benchmarks/benchmark_serving.py)
......@@ -134,7 +134,7 @@ python benchmarks/benchmark_serving.py --model internlm/internlm2.5-7b --dataset
启动服务:
```bash
python -m vllm.entrypoints.openai.api_server --model internlm/internlm2.5-7b --enforce-eager --dtype float16 --trust-remote-code
python -m vllm.entrypoints.openai.api_server --model internlm/internlm2_5-7b --enforce-eager --dtype float16 --trust-remote-code
```
这里 `--model`为加载模型路径,`--dtype`为数据类型:float16,默认情况使用tokenizer中的预定义聊天模板,`--chat-template`可以添加新模板覆盖默认模板,`-q gptq`为使用gptq量化模型进行推理,`-q awqq`为使用awq量化模型进行推理。
......@@ -151,7 +151,7 @@ curl http://localhost:8000/v1/models
curl http://localhost:8000/v1/completions \
-H "Content-Type: application/json" \
-d '{
"model": "internlm/internlm2.5-7b",
"model": "internlm/internlm2_5-7b",
"prompt": "What is deep learning?",
"max_tokens": 7,
"temperature": 0
......@@ -166,7 +166,7 @@ curl http://localhost:8000/v1/completions \
curl http://localhost:8000/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "internlm/internlm2.5-7b",
"model": "internlm/internlm2_5-7b",
"messages": [
{"role": "system", "content": "What is deep learning?"},
{"role": "user", "content": "What is deep learning?"}
......@@ -189,7 +189,7 @@ pip install gradio
2.1 启动gradio服务,根据提示操作
```
python gradio_openai_chatbot_webserver.py --model "internlm/internlm2.5-7b" --model-url http://localhost:8000/v1 --temp 0.8 --stop-token-ids ""
python gradio_openai_chatbot_webserver.py --model "internlm/internlm2_5-7b" --model-url http://localhost:8000/v1 --temp 0.8 --stop-token-ids ""
```
2.2 更改文件权限
......@@ -203,13 +203,13 @@ chmod +x frpc_linux_amd64_v0.*
3.启动OpenAI兼容服务
```
python -m vllm.entrypoints.openai.api_server --model internlm/internlm2.5-7b --enforce-eager --dtype float16 --trust-remote-code --port 8000
python -m vllm.entrypoints.openai.api_server --model internlm/internlm2_5-7b --enforce-eager --dtype float16 --trust-remote-code --port 8000
```
4.启动gradio服务
```
python gradio_openai_chatbot_webserver.py --model "internlm/internlm2.5-7b" --model-url http://localhost:8000/v1 --temp 0.8 --stop-token-ids ""
python gradio_openai_chatbot_webserver.py --model "internlm/internlm2_5-7b" --model-url http://localhost:8000/v1 --temp 0.8 --stop-token-ids ""
```
5.使用对话服务
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment