feat: add Gradio progress bar and streaming log updates during training
Browse files- integrated gr.Progress to show a visual progress bar
- streamed percentage updates (β³ Progress: XX%) to UI via yield
- preserved logging to both file and UI
- ensured training remains interactive and crash-safe
app.py
CHANGED
|
@@ -1,13 +1,16 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
from train_abuse_model import run_training
|
| 3 |
|
| 4 |
-
|
| 5 |
with gr.Blocks() as demo:
|
| 6 |
-
gr.Markdown("##
|
|
|
|
|
|
|
|
|
|
| 7 |
with gr.Row():
|
| 8 |
start_btn = gr.Button("π Start Training")
|
| 9 |
-
|
| 10 |
-
|
|
|
|
| 11 |
start_btn.click(fn=run_training, outputs=output_box)
|
| 12 |
|
| 13 |
if __name__ == "__main__":
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
from train_abuse_model import run_training
|
| 3 |
|
|
|
|
| 4 |
with gr.Blocks() as demo:
|
| 5 |
+
gr.Markdown("## π§ Abuse Detection Fine-Tuning App")
|
| 6 |
+
gr.Markdown(
|
| 7 |
+
"β οΈ **Important:** Keep this tab open and prevent your computer from sleeping while training runs."
|
| 8 |
+
)
|
| 9 |
with gr.Row():
|
| 10 |
start_btn = gr.Button("π Start Training")
|
| 11 |
+
|
| 12 |
+
output_box = gr.Textbox(label="Live Training Logs", lines=25, interactive=False)
|
| 13 |
+
|
| 14 |
start_btn.click(fn=run_training, outputs=output_box)
|
| 15 |
|
| 16 |
if __name__ == "__main__":
|