Skip to content
New issue

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

gradio网页demo的问答出现<p>字符 #173

Open
BUPTccy opened this issue Apr 26, 2023 · 2 comments
Open

gradio网页demo的问答出现<p>字符 #173

BUPTccy opened this issue Apr 26, 2023 · 2 comments

Comments

@BUPTccy
Copy link

BUPTccy commented Apr 26, 2023

想请问下网页的QA会带有<p>xxx</p>,哪怕在parse_text()中去除掉<p> 后台不显示<p>,网页输入输出也仍然显示该字符,应该如何解决呢
image

image

@BUPTccy BUPTccy mentioned this issue Apr 26, 2023
@PanQiWei
Copy link

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

应该和后处理对文本进行渲染有关,需要在这里进行处理才有用

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@BUPTccy @PanQiWei and others