hysts commited on
Commit
12250ff
1 Parent(s): 27916d0

Disable the use_wandb button when WANDB_API_KEY is not set

Browse files
Files changed (1) hide show
  1. app_training.py +6 -1
app_training.py CHANGED
@@ -2,6 +2,8 @@
2
 
3
  from __future__ import annotations
4
 
 
 
5
  import gradio as gr
6
 
7
  from constants import UploadTarget
@@ -73,7 +75,10 @@ def create_training_demo(trainer: Trainer,
73
  checkpointing_steps = gr.Number(label='Checkpointing Steps',
74
  value=100,
75
  precision=0)
76
- use_wandb = gr.Checkbox(label='Use W&B', value=False)
 
 
 
77
  validation_epochs = gr.Number(label='Validation Epochs',
78
  value=100,
79
  precision=0)
 
2
 
3
  from __future__ import annotations
4
 
5
+ import os
6
+
7
  import gradio as gr
8
 
9
  from constants import UploadTarget
 
75
  checkpointing_steps = gr.Number(label='Checkpointing Steps',
76
  value=100,
77
  precision=0)
78
+ use_wandb = gr.Checkbox(label='Use W&B',
79
+ value=False,
80
+ interactive=bool(
81
+ os.getenv('WANDB_API_KEY')))
82
  validation_epochs = gr.Number(label='Validation Epochs',
83
  value=100,
84
  precision=0)