报告一个chatGLM3 function_call的bugs
aofengdaxia opened this issue · comments
Shiyu Zhang commented
在chatGLM调用function call的时候,除了返回调用代码以后,还返回了一个<|observation|>标签。然后在chatGLM的官方代码中,他们使用了以下代码进行了过滤
response = tokenizer.decode(output_ids)
if response and response[-1] != "�":
response, stop_found = apply_stopping_strings(response, ["<|observation|>"])
yield {
"text": response,
"usage": {
"prompt_tokens": input_echo_len,
"completion_tokens": total_len - input_echo_len,
"total_tokens": total_len,
},
"finish_reason": "function_call" if stop_found else None,
}
if stop_found:
break
在使用fastllm的时候,返回的结果中,貌似把<|observation|>标签给过滤掉了。
Shiyu Zhang commented
使用stop_token_ids已经解决