From 3498f6085edee54d8e7d659ccfc2f784cd0fe547 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrien=20Gallou=C3=ABt?= Date: Fri, 21 Feb 2025 10:11:28 +0100 Subject: [PATCH] Update Gradio ChatInterface configuration in consuming_tgi.md (#3042) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The current code does not work and gives the following message: UserWarning: You have not specified a value for the `type` parameter. Defaulting to the 'tuples' format for chatbot messages, but this is deprecated and will be removed in a future version of Gradio. Please set type='messages' instead, which uses openai-style dictionaries with 'role' and 'content' keys. warnings.warn( Traceback (most recent call last): File "/Users/angt/hf/tgi/test-gradio.py", line 22, in gr.ChatInterface( TypeError: ChatInterface.__init__() got an unexpected keyword argument 'retry_btn' Signed-off-by: Adrien GallouĆ«t --- docs/source/basic_tutorials/consuming_tgi.md | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/docs/source/basic_tutorials/consuming_tgi.md b/docs/source/basic_tutorials/consuming_tgi.md index b07e7219..56237f9a 100644 --- a/docs/source/basic_tutorials/consuming_tgi.md +++ b/docs/source/basic_tutorials/consuming_tgi.md @@ -152,14 +152,10 @@ def inference(message, history): gr.ChatInterface( inference, - chatbot=gr.Chatbot(height=300), - textbox=gr.Textbox(placeholder="Chat with me!", container=False, scale=7), + type="messages", description="This is the demo for Gradio UI consuming TGI endpoint.", title="Gradio šŸ¤ TGI", examples=["Are tomatoes vegetables?"], - retry_btn="Retry", - undo_btn="Undo", - clear_btn="Clear", ).queue().launch() ```