Skip to content

Commit 88d2656

Browse files
vertex-sdk-botcopybara-github
authored andcommitted
fix: EvalTask evaluation should only display experiment button once for ipython environments
PiperOrigin-RevId: 711880078
1 parent a4d98cf commit 88d2656

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

google/cloud/aiplatform/metadata/metadata.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,7 @@ def set_experiment(
303303
] = None,
304304
project: Optional[str] = None,
305305
location: Optional[str] = None,
306+
display_button: bool = True,
306307
):
307308
"""Set the experiment. Will retrieve the Experiment if it exists or create one with the provided name.
308309
@@ -326,6 +327,8 @@ def set_experiment(
326327
location (str):
327328
Optional. Location where this experiment will be retrieved from or created. Overrides location set in
328329
aiplatform.init.
330+
display_button (bool):
331+
Optional. If set to `True`, displays a button to the experiment in the IPython notebook.
329332
"""
330333
self.reset()
331334

@@ -350,7 +353,8 @@ def set_experiment(
350353
if not current_backing_tb and backing_tb:
351354
experiment.assign_backing_tensorboard(tensorboard=backing_tb)
352355

353-
_ipython_utils.display_experiment_button(experiment)
356+
if display_button:
357+
_ipython_utils.display_experiment_button(experiment)
354358

355359
self._experiment = experiment
356360

vertexai/evaluation/eval_task.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,9 @@ def evaluate(
430430
retry_timeout=retry_timeout,
431431
)
432432
metadata._experiment_tracker.set_experiment(
433-
experiment=global_experiment_name, backing_tensorboard=False
433+
experiment=global_experiment_name,
434+
backing_tensorboard=False,
435+
display_button=False,
434436
)
435437
elif self._experiment and not global_experiment_name:
436438
metadata._experiment_tracker.set_experiment(

0 commit comments

Comments
 (0)