Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ModelZoo
ChatGLM_vllm
Commits
2869e209
Commit
2869e209
authored
Oct 21, 2024
by
laibao
Browse files
Update README.md
parent
0ac03a9b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
1 deletion
+39
-1
README.md
README.md
+39
-1
No files found.
README.md
View file @
2869e209
...
@@ -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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment