Skip to content

Commit

Permalink
fix: Create run_name when run_name_prefix is not specified for Tensor…
Browse files Browse the repository at this point in the history
…board uploader.

PiperOrigin-RevId: 637919611
  • Loading branch information
vertex-sdk-bot authored and Copybara-Service committed May 28, 2024
1 parent 94d838d commit ac17d87
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,10 @@ def send_request(self, run_name: str):
self._profile_dir(run_name)
)

tb_run = self._one_platform_resource_manager.get_run_resource_name(run_name)
tensorboard_run_name = run_name if run_name else "profile"
tb_run = self._one_platform_resource_manager.get_run_resource_name(
tensorboard_run_name
)

if run_name not in self._run_to_file_request_sender:
self._run_to_file_request_sender[
Expand Down
3 changes: 3 additions & 0 deletions google/cloud/aiplatform/tensorboard/uploader_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import re
import time
from typing import Callable, Dict, Generator, List, Optional, Tuple
import uuid

from absl import app
from google.api_core import exceptions
Expand Down Expand Up @@ -225,6 +226,8 @@ def _create_or_get_run_resource(
project=project, location=location, run_name=run_name
)
if not experiment_run:
if not run_name:
run_name = str(uuid.uuid4())
experiment_run = experiment_run_resource.ExperimentRun.create(
project=project,
location=location,
Expand Down

0 comments on commit ac17d87

Please sign in to comment.