From e5f258ecdd5f53eb261ec9e8a6f3fa7cfc609f82 Mon Sep 17 00:00:00 2001 From: Alexandre Strube Date: Fri, 26 Jan 2024 00:36:41 +0100 Subject: [PATCH] Copy button (#2963) --- fastchat/serve/gradio_block_arena_anony.py | 5 ++++- fastchat/serve/gradio_block_arena_named.py | 5 ++++- fastchat/serve/gradio_web_server.py | 1 + 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/fastchat/serve/gradio_block_arena_anony.py b/fastchat/serve/gradio_block_arena_anony.py index 6797290ba..188b993f7 100644 --- a/fastchat/serve/gradio_block_arena_anony.py +++ b/fastchat/serve/gradio_block_arena_anony.py @@ -518,7 +518,10 @@ def build_side_by_side_ui_anony(models): label = "Model A" if i == 0 else "Model B" with gr.Column(): chatbots[i] = gr.Chatbot( - label=label, elem_id=f"chatbot", height=550 + label=label, + elem_id=f"chatbot", + height=550, + show_copy_button=True, ) with gr.Row(): diff --git a/fastchat/serve/gradio_block_arena_named.py b/fastchat/serve/gradio_block_arena_named.py index 60823f06b..128dd7a50 100644 --- a/fastchat/serve/gradio_block_arena_named.py +++ b/fastchat/serve/gradio_block_arena_named.py @@ -307,7 +307,10 @@ def build_side_by_side_ui_named(models): label = "Model A" if i == 0 else "Model B" with gr.Column(): chatbots[i] = gr.Chatbot( - label=label, elem_id=f"chatbot", height=550 + label=label, + elem_id=f"chatbot", + height=550, + show_copy_button=True, ) with gr.Row(): diff --git a/fastchat/serve/gradio_web_server.py b/fastchat/serve/gradio_web_server.py index 523491e28..512538323 100644 --- a/fastchat/serve/gradio_web_server.py +++ b/fastchat/serve/gradio_web_server.py @@ -678,6 +678,7 @@ def build_single_model_ui(models, add_promotion_links=False): elem_id="chatbot", label="Scroll down and start chatting", height=550, + show_copy_button=True, ) with gr.Row(): textbox = gr.Textbox(