File size: 420 Bytes
359afbc 913ffcb 66ddc8e 359afbc 66ddc8e 359afbc 66ddc8e 359afbc |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# app.py
import gradio as gr
def echo(message, history):
history = history or []
reply = f"Ты написал: {message}"
history.append((message, reply))
return history, history
demo = gr.ChatInterface(
fn=echo,
type="messages",
examples=["Привет", "Как дела?", "Расскажи шутку"],
title="Echo Bot на Gradio"
)
if __name__ == "__main__":
demo.launch()
|