Skip to content

[Question]: deepseek not work fine with ragflow #5632

Open
@fivegg

Description

@fivegg

Describe your problem

由于deepseek输出会有思维过程,导致ragflow多轮对话和关键词提取的调用llm的地方输出结果包含标签,导致效果不好。目前手动修改llm_service.py chat函数能暂时改进一些。
def chat(self, system, history, gen_conf):
#add by robintan: remove tag
system = re.sub(r'.?', '', system, flags=re.DOTALL).strip()
txt, used_tokens = self.mdl.chat(system, history, gen_conf)
if isinstance(txt, int) and not TenantLLMService.increase_usage(
self.tenant_id, self.llm_type, used_tokens, self.llm_name):
logging.error(
"LLMBundle.chat can't update token usage for {}/CHAT llm_name: {}, used_tokens: {}".format(self.tenant_id, self.llm_name,
used_tokens))
#add by robintan: remove tag
txt = re.sub(r'.
?', '', txt, flags=re.DOTALL).strip()
return txt

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions