MOSS
MOSS copied to clipboard
gradio网页demo的问答出现<p>字符
想请问下网页的QA会带有<p>xxx</p>
,哪怕在parse_text()中去除掉<p>
后台不显示<p>
,网页输入输出也仍然显示该字符,应该如何解决呢
def postprocess(self, y):
if y is None:
return []
for i, (message, response) in enumerate(y):
y[i] = (
None if message is None else mdtex2html.convert((message)),
None if response is None else mdtex2html.convert(response),
)
return y
gr.Chatbot.postprocess = postprocess
应该和后处理对文本进行渲染有关,需要在这里进行处理才有用