| import gradio as gr | |
| import os | |
| # Function to start training | |
| def start_training(): | |
| os.system("python train.py") # Runs your training script | |
| return "Training Started! 🚀 Check logs in 'train_log.txt'." | |
| # Create Gradio UI | |
| iface = gr.Interface( | |
| fn=start_training, | |
| inputs=[], | |
| outputs="text", | |
| title="Train TinyLlama on Hugging Face Spaces", | |
| description="Click the button below to start fine-tuning TinyLlama." | |
| ) | |
| # Launch the Gradio app | |
| iface.launch() | |