[in]失败后停止【值/表达式】True
[in]网址【值/表达式】https://api-inference.huggingface.co/models/Qwen/Qwen2.5-72B-Instruct/v1/chat/completions\r\n
[in]方法【值/表达式】POST
[in]请求头【值/表达式】Authorization: Bearer hf_xxxxxxxxxxxxxxxxxx\r\n Content-Type: application/json\r\n
[in]请求体类型【值/表达式】JSON
[in]请求体【值/表达式】 \r\n {\r\n "model": "Qwen/Qwen2.5-72B-Instruct",\r\n "messages": [\r\n {\r\n "role": "user",\r\n "content": "{ 判断我的输入是英文句子还是中文句子。\nif:英文句子:\n将英文句子翻译成自然流畅的中文,同时保留其原意和风格。\n请注意:避免直译,确保翻译后的中文句子读起来自然、通顺,并且适合中文的语言习惯。\nelse:中文句子:\n将我输入的中文翻译到英文,请注意将我的中文表达理解清楚,然后用通俗易懂的,恰当的自然的翻译到英文句子。\n\n输入的句子是以下部分:\r\n /// Significantly more knowledge and has greatly improved capabilities in coding and mathematics, thanks to our specialized expert models in these domains.\r\n Significant improvements in instruction following, generating long texts (over 8K tokens), understanding structured data (e.g, tables), and generating structured outputs especially JSON. More resilient to the diversity of system prompts, enhancing role-play implementation and condition-setting for chatbots.\r\n Long-context Support up to 128K tokens and can generate up to 8K tokens.\r\n Multilingual support for over 29 languages, including Chinese, English, French, Spanish, Portuguese, German, Italian, Russian, Japanese, Korean, Vietnamese, Thai, Arabic, and more.}"\r\n }\r\n ],\r\n "max_tokens": 3072,\r\n "stream": false\r\n }\r\n \r\n
[in]禁止重定向【值/表达式】False
[in]UserAgent【值/表达式】
[in]超时时间【值/表达式】1000
[in]显示进度条【值/表达式】False
[in]忽略HTTPS证书验证【值/表达式】False
[in]强制使用代理【值/表达式】False
[in]启用SSE流式响应【值/表达式】False
请求头Content-Type可能不合法。头名称误用。请确保将请求头用于 HttpRequestMessage,将响应头用于 HttpResponseMessage,将内容头用于 HttpContent 对象。
[in]Cookie【值/表达式】
非Get请求(POST), 处理请求体。
[in]内容类型【值/表达式】
发送JSON格式。
[in]结果类型【值/表达式】Text
[out]文本结果=>json_resultsFailed to parse the request body as JSON: messages[0].content: control character (\u0000-\u001F) found while parsing a string at line 7 column 518
耗时:984ms
------------------------------
可以看到,好像是content内的不能有\r\n,但是这是变量内自动带的。。我的请求体是这么写的
$$
{
"model": "Qwen/Qwen2.5-72B-Instruct",
"messages": [
{
"role": "user",
"content": "{ {本体prompt} /// {text}}"
}
],
"max_tokens": 3072,
"stream": false
}
------------------------------
然后我和gpt聊了半天,发现可能是quicker 的问题,会把变量内的换行变成\r\n。然后导致发送的json不合法。。
但是我实际不是很懂程序,这只是我和gpt聊天得到的结论,开发人员能看看对不对吗?如果是我这的操作有问题,应该如何解决??感谢大家