import gradio as gr import json import os def check_status(): return "🧬 EVEZ Training Pipeline\n\nStatus: Space online (CPU)\nTraining data: 96 examples loaded\n\n⚠️ For GPU training: Settings → Hardware → T4 GPU ($0.05/hr)" def run_training(epochs, lr): try: import torch if not torch.cuda.is_available(): return "⚠️ No GPU. Enable T4 in Space Settings → Hardware → Factory Rebuild." return f"🧠 Training: {epochs} epochs, lr={lr}\nGPU: {torch.cuda.get_device_name(0)}" except ImportError: return "⚠️ PyTorch missing. Enable GPU hardware to install torch." with gr.Blocks(title="EVEZ Trainer") as demo: gr.Markdown("# 🧬 EVEZ Self-Training Pipeline\nnFine-tune on 96 EVEZ instruction pairs.") with gr.Row(): epochs = gr.Slider(1, 10, value=3, step=1, label="Epochs") lr = gr.Slider(1e-6, 1e-3, value=2e-4, label="Learning Rate") train_btn = gr.Button("Start Training", variant="primary") output = gr.Textbox(label="Output", lines=10) train_btn.click(run_training, [epochs, lr], output) if __name__ == "__main__": demo.launch()