mirror of
https://git.mirrors.martin98.com/https://github.com/infiniflow/ragflow.git
synced 2025-08-17 04:35:55 +08:00
examples empty in categorize (#1422)
### What problem does this PR solve? Examples empty in categorize ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
parent
593c20889d
commit
c889ef6363
@ -43,7 +43,7 @@ class CategorizeParam(GenerateParam):
|
|||||||
def get_prompt(self):
|
def get_prompt(self):
|
||||||
cate_lines = []
|
cate_lines = []
|
||||||
for c, desc in self.category_description.items():
|
for c, desc in self.category_description.items():
|
||||||
for l in desc["examples"].split("\n"):
|
for l in desc.get("examples", "").split("\n"):
|
||||||
if not l: continue
|
if not l: continue
|
||||||
cate_lines.append("Question: {}\tCategory: {}".format(l, c))
|
cate_lines.append("Question: {}\tCategory: {}".format(l, c))
|
||||||
descriptions = []
|
descriptions = []
|
||||||
|
@ -107,7 +107,7 @@ class Dealer:
|
|||||||
if re.match(p, t):
|
if re.match(p, t):
|
||||||
tk = "#"
|
tk = "#"
|
||||||
break
|
break
|
||||||
tk = re.sub(r"([\+\\-])", r"\\\1", tk)
|
#tk = re.sub(r"([\+\\-])", r"\\\1", tk)
|
||||||
if tk != "#" and tk:
|
if tk != "#" and tk:
|
||||||
res.append(tk)
|
res.append(tk)
|
||||||
return res
|
return res
|
||||||
|
Loading…
x
Reference in New Issue
Block a user