| import gradio as gr | |
| # Function to interact with the model | |
| def chatbot_response(input_text): | |
| # Here you would use your model for inference | |
| # This is a placeholder for your actual model's prediction logic | |
| response = f"Model Response: {input_text}" | |
| return response | |
| # Create the Gradio interface | |
| with gr.Blocks() as demo: | |
| chatbot = gr.Chatbot() | |
| with gr.Row(): | |
| txt = gr.Textbox(show_label=False, placeholder="Enter text and press Enter").style(container=False) | |
| txt.submit(chatbot_response, txt, chatbot) | |
| demo.launch() | |