Text Generation
Transformers
Safetensors
step3p5
conversational
custom_code
Eval Results
File size: 413 Bytes
449c85d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import gradio as gr

def chat_response(message, history):
    history.append((message, f"Bot says: {message}"))
    return "", history

with gr.Blocks() as demo:
    gr.Markdown("# Chat Demo")
    chatbot = gr.Chatbot()
    msg = gr.Textbox(label="Message")
    clear = gr.Button("Clear")
    
    msg.submit(chat_response, [msg, chatbot], [msg, chatbot])
    clear.click(lambda: [], None, chatbot)

demo.launch()