【求助帖】Chinese LLaMA Alpaca系列模型OpenAI API调用实现 curl使用的问题 #499

Open
opened 2025-02-05 21:33:17 +08:00 by CharlieXie · 3 comments

我现在使用的是汇视威云平台,如何通过curl访问大模型API?
通过gitbash启动大模型后输出:image
新开的一个gitbash并逐行输入如下内容
curl http://0.0.0.0:19327/v1/chat/completions
-H "Content-Type: application/json"
-H "Authorization: Bearer x"
-d '{
"model": "llama-3-chinese",
"messages": [
{
"role": "user",
"content": "1+1等于⼏?"
}
],
"max_tokens": 4096
}'
image
返回错误:
image

我现在使用的是汇视威云平台,如何通过curl访问大模型API? 通过gitbash启动大模型后输出:<img width="949" alt="image" src="/attachments/9963407c-f0f3-4eb6-ab0c-5b611112728f"> 新开的一个gitbash并逐行输入如下内容 curl http://0.0.0.0:19327/v1/chat/completions \ -H "Content-Type: application/json" \ -H "Authorization: Bearer x" \ -d '{ "model": "llama-3-chinese", "messages": [ { "role": "user", "content": "1+1等于⼏?" } ], "max_tokens": 4096 }' <img width="553" alt="image" src="/attachments/ed374fb3-a894-475a-9b6b-57f84cb21c21"> 返回错误: <img width="767" alt="image" src="/attachments/1cd8c006-063c-4b1f-a5fb-a6bfca7a80c0">

把curl http://0.0.0.0:19327替换成:curl http://127.0.0.1:19327试试。127.0.0.1代表是本地本机IP

把curl http://0.0.0.0:19327替换成:curl http://127.0.0.1:19327试试。127.0.0.1代表是本地本机IP
Author

把curl http://0.0.0.0:19327替换成:curl http://127.0.0.1:19327试试。127.0.0.1代表是本地本机IP
@rayhsw 换成127.0.0.1后还是不行,输出的内容转html后如下:

image
> 把curl http://0.0.0.0:19327替换成:curl http://127.0.0.1:19327试试。127.0.0.1代表是本地本机IP @rayhsw 换成127.0.0.1后还是不行,输出的内容转html后如下: <img width="577" alt="image" src="/attachments/43004cc6-870a-43ea-87e6-00505fb04d49">

在汇视威训练平台的jupyter里面输入命令。

在汇视威训练平台的jupyter里面输入命令。
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: HswOAuth/llm_course#499
No description provided.