cgt-llm-chatbot-v2 / test_minimal.py
arahrooh's picture
Add minimal test demo
8c0206d
raw
history blame
707 Bytes
"""
Minimal test to verify Gradio works on Spaces
"""
import gradio as gr
import os
# Check if we're on Spaces
IS_SPACES = (
os.getenv("SPACE_ID") is not None or
os.getenv("SYSTEM") == "spaces" or
os.getenv("HF_SPACE_ID") is not None
)
# Create a minimal demo
with gr.Blocks(title="Test Demo") as demo:
gr.Markdown("# Test Demo")
gr.Markdown("If you see this, Gradio is working!")
text_input = gr.Textbox(label="Test Input")
text_output = gr.Textbox(label="Test Output")
def echo(text):
return f"You said: {text}"
text_input.submit(echo, inputs=text_input, outputs=text_output)
print(f"Demo created: {type(demo)}")
print(f"IS_SPACES: {IS_SPACES}")