We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
llamafactory
训练数据如alpaca格式,在output中的思维过程前后增加和, 无system prompt
训练过程中loss正常,但用vllm部署服务后,用openai接口请求输出结果没有和,这里很奇怪为什么和不遵循?
在源码中看到这里对和</think>进行了特殊处理,请问是这个原因吗?把前后这2个标签丢掉了? @DataClass class FunctionFormatter(StringFormatter): def post_init(self): super().post_init() self.tool_utils = get_tool_utils(self.tool_format)
@override def apply(self, **kwargs) -> SLOTS: content: str = kwargs.pop("content") regex = re.compile(r"<think>(.*)</think>", re.DOTALL) thought = re.search(regex, content) if thought: content = content.replace(thought.group(0), "") functions: List["FunctionCall"] = [] try: tool_calls = json.loads(content) if not isinstance(tool_calls, list): # parallel function call tool_calls = [tool_calls] for tool_call in tool_calls: functions.append( FunctionCall(tool_call["name"], json.dumps(tool_call["arguments"], ensure_ascii=False)) ) except json.JSONDecodeError: raise RuntimeError(f"Invalid JSON format in function message: {str([content])}.") # flat string function_str = self.tool_utils.function_formatter(functions) if thought: function_str = thought.group(1) + function_str return super().apply(content=function_str)
Put your message here.
No response
The text was updated successfully, but these errors were encountered:
追加,提问内容的“"和“”内容不见了
Sorry, something went wrong.
think标签不输出了,带尖括号
No branches or pull requests
Reminder
System Info
llamafactory
version: 0.9.2.dev0训练数据如alpaca格式,在output中的思维过程前后增加和, 无system prompt
训练过程中loss正常,但用vllm部署服务后,用openai接口请求输出结果没有和,这里很奇怪为什么和不遵循?
在源码中看到这里对和</think>进行了特殊处理,请问是这个原因吗?把前后这2个标签丢掉了?
@DataClass
class FunctionFormatter(StringFormatter):
def post_init(self):
super().post_init()
self.tool_utils = get_tool_utils(self.tool_format)
Reproduction
Others
No response
The text was updated successfully, but these errors were encountered: