Commit 2869e209 authored by laibao's avatar laibao
Browse files

Update README.md

parent 0ac03a9b
...@@ -165,7 +165,45 @@ curl http://localhost:8000/v1/chat/completions \ ...@@ -165,7 +165,45 @@ curl http://localhost:8000/v1/chat/completions \
}' }'
``` ```
或者使用[examples/openai_chatcompletion_client.py](examples/openai_chatcompletion_client.py) 或者使用[examples/openai_chatcompletion_client.py](examples/openai_chatcompletion_client.py)
### **gradio和vllm结合使用**
1.安装gradio
```
pip install gradio
```
2.安装必要文件
2.1 启动gradio服务,根据提示操作
```
python gradio_openai_chatbot_webserver.py --model "THUDM/glm-4-9b-chat" --model-url http://localhost:8000/v1 --temp 0.8 --stop-token-ids ""
```
2.2 更改文件权限
打开提示下载文件目录,输入以下命令给予权限
```
chmod +x frpc_linux_amd64_v0.*
```
3.启动OpenAI兼容服务
```
python -m vllm.entrypoints.openai.api_server --model THUDM/glm-4-9b-chatt --enforce-eager --dtype float16 --trust-remote-code --port 8000
```
4.启动gradio服务
```
python gradio_openai_chatbot_webserver.py --model "THUDM/glm-4-9b-chat" --model-url http://localhost:8000/v1 --temp 0.8 --stop-token-ids ""
```
5.使用对话服务
在浏览器中输入本地 URL,可以使用 Gradio 提供的对话服务。
## result ## result
使用的加速卡:1张 DCU-K100_AI-64G 使用的加速卡:1张 DCU-K100_AI-64G
...@@ -189,4 +227,4 @@ Prompt: '晚上睡不着怎么办', Generated text: '?\n晚上睡不着可以 ...@@ -189,4 +227,4 @@ Prompt: '晚上睡不着怎么办', Generated text: '?\n晚上睡不着可以
## 参考资料 ## 参考资料
* [https://github.com/vllm-project/vllm](https://github.com/vllm-project/vllm) * [https://github.com/vllm-project/vllm](https://github.com/vllm-project/vllm)
* [https://github.com/THUDM/ChatGLM3](https://github.com/THUDM/ChatGLM3) * [https://github.com/THUDM/ChatGLM3](https://github.com/THUDM/ChatGLM3)
\ No newline at end of file
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