Преглед на файлове

Remove <think> content for `Generate` if it's not stream output. (#5281)

### What problem does this PR solve?

### Type of change

- [x] Refactoring
tags/v0.17.0
Kevin Hu преди 8 месеца
родител
ревизия
bcc92e04c9
No account linked to committer's email address
променени са 1 файла, в които са добавени 1 реда и са изтрити 0 реда
  1. 1
    0
      agent/component/generate.py

+ 1
- 0
agent/component/generate.py Целия файл

if len(msg) < 2: if len(msg) < 2:
msg.append({"role": "user", "content": "Output: "}) msg.append({"role": "user", "content": "Output: "})
ans = chat_mdl.chat(msg[0]["content"], msg[1:], self._param.gen_conf()) ans = chat_mdl.chat(msg[0]["content"], msg[1:], self._param.gen_conf())
ans = re.sub(r"<think>.*</think>", "", ans, flags=re.DOTALL)


if self._param.cite and "content_ltks" in retrieval_res.columns and "vector" in retrieval_res.columns: if self._param.cite and "content_ltks" in retrieval_res.columns and "vector" in retrieval_res.columns:
res = self.set_cite(retrieval_res, ans) res = self.set_cite(retrieval_res, ans)

Loading…
Отказ
Запис