File size: 468 Bytes
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: str,
chat_history: list[dict],
):
output = ""
for character in message:
output += character
yield output
demo = gr.ChatInterface(
fn=generate,
examples=[
["Hey"],
["Can you explain briefly to me what is the Python programming language?"],
],
cache_examples=True,
cache_mode="eager",
type="messages",
)
if __name__ == "__main__":
demo.launch()
|