Skip to content

Commit c033c59

Browse files
sararobcopybara-github
authored andcommitted
docs: update docstring for start_upload_tb_log()
PiperOrigin-RevId: 592648615
1 parent cd31c13 commit c033c59

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

google/cloud/aiplatform/tensorboard/uploader_tracker.py

+12
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,18 @@ def start_upload_tb_log(
106106
):
107107
"""continues to listen for new data in the logdir and uploads when it appears.
108108
109+
Note that after calling `start_upload_tb_log()` your thread will kept alive even if
110+
an exception is thrown. To ensure the thread gets shut down, put any code after
111+
`start_upload_tb_log()` and before `end_upload_tb_log()` in a `try` statement, and call
112+
`end_upload_tb_log()` in `finally`. For example:
113+
114+
aiplatform.start_upload_tb_log(...)
115+
116+
try:
117+
# your code here
118+
finally:
119+
aiplatform.end_upload_tb_log()
120+
109121
```
110122
Sample usage:
111123
aiplatform.init(location='us-central1', project='my-project')

0 commit comments

Comments
 (0)