mirror of
https://github.com/huggingface/text-generation-inference.git
synced 2025-04-22 15:32:08 +00:00
Update Gradio ChatInterface configuration in consuming_tgi.md (#3042)
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 <module> gr.ChatInterface( TypeError: ChatInterface.__init__() got an unexpected keyword argument 'retry_btn' Signed-off-by: Adrien Gallouët <adrien@gallouet.fr>
This commit is contained in:
parent
142a49a80d
commit
3498f6085e
@ -152,14 +152,10 @@ def inference(message, history):
|
|||||||
|
|
||||||
gr.ChatInterface(
|
gr.ChatInterface(
|
||||||
inference,
|
inference,
|
||||||
chatbot=gr.Chatbot(height=300),
|
type="messages",
|
||||||
textbox=gr.Textbox(placeholder="Chat with me!", container=False, scale=7),
|
|
||||||
description="This is the demo for Gradio UI consuming TGI endpoint.",
|
description="This is the demo for Gradio UI consuming TGI endpoint.",
|
||||||
title="Gradio 🤝 TGI",
|
title="Gradio 🤝 TGI",
|
||||||
examples=["Are tomatoes vegetables?"],
|
examples=["Are tomatoes vegetables?"],
|
||||||
retry_btn="Retry",
|
|
||||||
undo_btn="Undo",
|
|
||||||
clear_btn="Clear",
|
|
||||||
).queue().launch()
|
).queue().launch()
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user