@@ -61,7 +61,7 @@ def interactive_plots(
6161 "valid_batch_size" : hyperparams .get ("dataloaders" , {}).get ("valid_batch_size" ,1 ),
6262 }
6363 num_workers = hyperparams .get ("dataloaders" , {}).get ("num_workers" , 4 )
64- perplexity = hyperparams .get ("perplexity" , 30 )
64+ perplexity = hyperparams .get ("perplexity" )
6565
6666 plot_config = {
6767 "color_classes" : hyperparams .get ("color_classes" , None ),
@@ -71,11 +71,13 @@ def interactive_plots(
7171 }
7272
7373
74- ## Set up directories
74+ ## directories and file management
7575 data_dir = os .path .join (root_dir , "data" , run_name )
76- plot_path = os .path .join (root_dir , "plots" , run_name , f"embeddings_{ run_name } .html" )
76+ plot_dir = os .path .join (root_dir , "plots" , run_name )
77+ os .makedirs (plot_dir , exist_ok = True )
78+ plot_path = os .path .join (plot_dir , "embeddings_interactive_plot.html" )
7779 if not overwrite and not kwargs .get ("ret_embeddings" ):
78- assert not os .path .isfile (plot_path ), f"File exists: { plot_path } "
80+ assert not os .path .isfile (plot_path ), f"File already exists: { plot_path } "
7981
8082 ## Load model and set up
8183 print (f"Checkpoint: using { checkpoint } of { stage } stage" )
0 commit comments