Set data path to launch viewer for DreamFusion (#1776)

* Set data path to launch viewer for DreamFusion

* Apply formatter

* Fallback to 'base_dir' if data manager has no path

* Make if statement non-inline

* Reformat

---------

Co-authored-by: Matthew Tancik <mattt4001@gmail.com>
This commit is contained in:
SeungWoo YooandMatthew Tancik authored and GitHub committed 2023-04-19 21:47:34 -07:00
1 parent a449219f91
commit cc494adb27
1 file changed
+8 -1
+8 -1
View File
@@ -61,8 +61,15 @@ class RunViewer:
def _start_viewer(self, config: TrainerConfig, pipeline: Pipeline):
base_dir = config.get_base_dir()
viewer_log_path = base_dir / config.viewer.relative_log_filename
datapath = pipeline.datamanager.get_datapath()
if datapath is None:
datapath = base_dir
viewer_state, banner_messages = viewer_utils.setup_viewer(
config.viewer, log_filename=viewer_log_path, datapath=pipeline.datamanager.get_datapath()
config.viewer,
log_filename=viewer_log_path,
datapath=datapath,
)
# We don't need logging, but writer.GLOBAL_BUFFER needs to be populated