rshakked commited on
Commit
9364099
Β·
1 Parent(s): 5c16708

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

Files changed (1) hide show
  1. app.py +7 -4
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("## πŸš€ Fine-tune DeBERTa on abuse dataset")
 
 
 
7
  with gr.Row():
8
  start_btn = gr.Button("πŸš€ Start Training")
9
- output_box = gr.Textbox(label="Training Logs", lines=25)
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__":