Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
import os
|
3 |
+
|
4 |
+
# Function to start training
|
5 |
+
def start_training():
|
6 |
+
os.system("python train.py") # Runs your training script
|
7 |
+
return "Training Started! 🚀 Check logs in 'train_log.txt'."
|
8 |
+
|
9 |
+
# Create Gradio UI
|
10 |
+
iface = gr.Interface(
|
11 |
+
fn=start_training,
|
12 |
+
inputs=[],
|
13 |
+
outputs="text",
|
14 |
+
title="Train TinyLlama on Hugging Face Spaces",
|
15 |
+
description="Click the button below to start fine-tuning TinyLlama."
|
16 |
+
)
|
17 |
+
|
18 |
+
# Launch the Gradio app
|
19 |
+
iface.launch()
|