dn6 HF staff commited on
Commit
4222b0d
1 Parent(s): f0e9ec4

add experiment status button

Browse files
Files changed (1) hide show
  1. app.py +5 -0
app.py CHANGED
@@ -47,6 +47,9 @@ class MyProject:
47
  self.experiment.end()
48
  return f"Ended {self.experiment.name}"
49
 
 
 
 
50
  def start_comet_interface(self):
51
  demo = gr.Blocks()
52
  with demo:
@@ -57,6 +60,7 @@ class MyProject:
57
 
58
  with gr.Row():
59
  start_experiment = gr.Button("Start Experiment", variant="primary")
 
60
  end_experiment = gr.Button("End Experiment", variant="secondary")
61
 
62
  output = gr.Markdown(label="Status")
@@ -70,6 +74,7 @@ class MyProject:
70
  ],
71
  outputs=output,
72
  )
 
73
  end_experiment.click(self.end_experiment, inputs=None, outputs=output)
74
 
75
  return demo
 
47
  self.experiment.end()
48
  return f"Ended {self.experiment.name}"
49
 
50
+ def get_experiment_status(self):
51
+ return f"Running {self.experiment.name}"
52
+
53
  def start_comet_interface(self):
54
  demo = gr.Blocks()
55
  with demo:
 
60
 
61
  with gr.Row():
62
  start_experiment = gr.Button("Start Experiment", variant="primary")
63
+ status = gr.Button("Experiment Status")
64
  end_experiment = gr.Button("End Experiment", variant="secondary")
65
 
66
  output = gr.Markdown(label="Status")
 
74
  ],
75
  outputs=output,
76
  )
77
+ status.click(self.get_experiment_status, inputs=None, outputs=None)
78
  end_experiment.click(self.end_experiment, inputs=None, outputs=output)
79
 
80
  return demo