将webui对话以聊天框的样式显示

pull/163/head
l15y 2023-03-20 09:28:42 +08:00
parent 69bcdcbc4f
commit ea28ba13bb
2 changed files with 11 additions and 1 deletions

10
html/style.css Normal file
View File

@ -0,0 +1,10 @@
.contain div div:nth-child(2n-1) div [data-testid="markdown"] p {
background: #bcffb0aa;
margin-left: auto;
}
[data-testid="markdown"] p {
width: fit-content;
padding: 1em;
background: #cececeaa;
border-radius: 16px;
}

View File

@ -23,7 +23,7 @@ def predict(input, max_length, top_p, temperature, history=None):
yield [history] + updates
with gr.Blocks() as demo:
with gr.Blocks(css="html/style.css", analytics_enabled=False) as demo:
state = gr.State([])
text_boxes = []
for i in range(MAX_BOXES):