test_chatinterface_examples_main / multimodal_messages_examples_testcase.py
freddyaboulton's picture
Upload folder using huggingface_hub
3bf10cf verified
raw
history blame contribute delete
495 Bytes
import gradio as gr
def generate(
message: dict,
chat_history: list[dict],
):
output = ""
for character in message['text']:
output += character
yield output
demo = gr.ChatInterface(
fn=generate,
examples=[
[{"text": "Hey"}],
[{"text": "Can you explain briefly to me what is the Python programming language?"}],
],
cache_examples=False,
type="messages",
multimodal=True,
)
if __name__ == "__main__":
demo.launch()