-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
scripts/oai_api_demo/openai_api_server.py 使用多张gpu失败 #22
Comments
单卡推理速度较慢,我的gpu配置:A800(80G) |
调用/v1/embeddings时,报以下错: |
多卡问题不太清楚,自行排查吧。 completion请求:
返回: chat请求:
返回: embedding请求:
返回: |
2024-05-07 08:36:06,090 - INFO - 172.23.0.1:51046 - "POST /v1/chat/completions HTTP/1.1" 200 @ymcui 又出现了这样的问题 |
模型加载错了,使用 |
是的,已修正。 |
你用的transformers版本是多少?相关依赖版本贴出来。 |
4.40.2 @ymcui |
Package Version accelerate 0.30.0 |
你转换权重的时候不要只下载safetensors权重,tokenizer相关的文件也是要更新的。 |
没有转换权重 |
你可以试试把openai_api_server.py中predict函数和stream_predict函数中,所有的 |
我加了这些之后,get_embedding还是会报错。是不是这里对get_embedding没有作用呢? 以下是报错信息: 2024-05-15 11:54:31,780 - ERROR - Exception in ASGI application |
该问题好像解决了,就是在openai_api_server.py的get_embedding函数中encoding = tokenizer(input,padding=True, return tensors="pt")前面增加一行: |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your consideration. |
Closing the issue, since no updates observed. Feel free to re-open if you need any further assistance. |
提交前必须检查以下项目
问题类型
模型推理
基础模型
Llama-3-Chinese-8B-Instruct(指令模型)
操作系统
Linux
详细描述问题
依赖情况(代码类问题务必提供)
运行日志或截图
python openai_api_server.py --base_model models/llama-3-chinese-8b/ --gpus 1,2
指定使用多张gpu
测试:
curl http://0.0.0.0:19327/v1/completions
-H "Content-Type: application/json"
-d '{
"prompt": "请你介绍一下中国的首都"
}'
一直没有json返回体
但如果是使用单卡,就不使用--gpus,则返回正常,有json返回体
The text was updated successfully, but these errors were encountered: