| #!/usr/bin/env python3 | |
| import gradio as gr | |
| import sys | |
| import traceback | |
| print("Starting minimal demo test...") | |
| try: | |
| # Test basic Gradio functionality | |
| def simple_chat(message, history): | |
| return history + [[message, f"Echo: {message}"]] | |
| with gr.Blocks(title="Test Demo") as demo: | |
| gr.Markdown("# Test Demo") | |
| chatbot = gr.Chatbot() | |
| msg = gr.Textbox(placeholder="Type a message...") | |
| msg.submit(simple_chat, [msg, chatbot], [chatbot]) | |
| print("Demo created successfully, launching...") | |
| demo.launch(server_name="localhost", server_port=7861, share=False) | |
| except Exception as e: | |
| print(f"Error: {e}") | |
| traceback.print_exc() |