File size: 495 Bytes
b907f7c 3bf10cf |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
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()
|