From ea28ba13bb17c874605868b33b41518f644acf5d Mon Sep 17 00:00:00 2001 From: l15y Date: Mon, 20 Mar 2023 09:28:42 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=86webui=E5=AF=B9=E8=AF=9D=E4=BB=A5?= =?UTF-8?q?=E8=81=8A=E5=A4=A9=E6=A1=86=E7=9A=84=E6=A0=B7=E5=BC=8F=E6=98=BE?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- html/style.css | 10 ++++++++++ web_demo.py | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 html/style.css diff --git a/html/style.css b/html/style.css new file mode 100644 index 0000000..e2c99a3 --- /dev/null +++ b/html/style.css @@ -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; +} \ No newline at end of file diff --git a/web_demo.py b/web_demo.py index 39709a7..3ca6eb5 100644 --- a/web_demo.py +++ b/web_demo.py @@ -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):