File size: 1,095 Bytes
856baa5 bb7a81b 856baa5 | 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 27 28 29 | import gradio as gr
import time
def generate_video(prompt):
# This is where your AI generation code will go later.
# For now, we simulate the "Thinking" process for the demo.
time.sleep(2)
return "https://www.youtube.com/watch?v=isoCNqQeMv8" # Placeholder math video
# Custom CSS to match your "Dark Mode" Website
custom_css = """
body {background-color: #0F172A; color: white;}
.gradio-container {background-color: #0F172A; border: none;}
h1 {color: #4ADE80; font-family: 'Arial', sans-serif;}
"""
with gr.Blocks(css=custom_css) as demo:
gr.Markdown("# 🧠 Zulense AI: Class 8 & 9 Math Tutor")
gr.Markdown("Type a math question below (e.g., 'Explain Pythagoras Theorem') and watch the AI generate a video.")
with gr.Row():
input_text = gr.Textbox(label="Enter Math Question", placeholder="Type here...")
generate_btn = gr.Button("Generate Video 🎥", variant="primary")
output_video = gr.Video(label="AI Generated Explanation")
generate_btn.click(fn=generate_video, inputs=input_text, outputs=output_video)
demo.launch() |