File size: 704 Bytes
712579e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
#!/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()