baakaani commited on
Commit
aff5dca
·
1 Parent(s): f4d370a

changes to dashboard

Browse files
Files changed (1) hide show
  1. utils/config_fabric.py +23 -4
utils/config_fabric.py CHANGED
@@ -285,17 +285,18 @@ if __name__ == '__main__':
285
 
286
  # Simulate running the command with a loop and updating the progress bar
287
  for i in range(95):
288
- time.sleep(0.1) # Simulate the time taken for each step
289
  progress_bar.progress(i + 1)
290
 
291
  # Run the actual command
292
  result = subprocess.run(command, capture_output=True, text=True)
293
  st.write("## Results")
294
- st.write(*step_config['generator_params']['experiment'][0].keys(), "log name", "target similarity")
295
 
296
  directory = Path(step_config['output_path']).parts
297
  path = os.path.join(directory[0], 'features', *directory[1:])
298
 
 
299
  # Walk through all directories and files
300
  for root, dirs, files in os.walk(path):
301
  feature_files = [os.path.join(root, file) for file in files]
@@ -306,9 +307,27 @@ if __name__ == '__main__':
306
  index = int(data['log'].split('genEL')[-1].split('_')[0])-1
307
  config_targets = step_config['generator_params']['experiment'][index]
308
 
 
 
309
  # Print the contents of the JSON file
310
- st.write(*config_targets.values(), data['log'], data['target_similarity'])
311
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
312
  # Optional: Updating the progress bar to indicate completion
313
  progress_bar.progress(100)
314
 
 
285
 
286
  # Simulate running the command with a loop and updating the progress bar
287
  for i in range(95):
288
+ time.sleep(0.2) # Simulate the time taken for each step
289
  progress_bar.progress(i + 1)
290
 
291
  # Run the actual command
292
  result = subprocess.run(command, capture_output=True, text=True)
293
  st.write("## Results")
294
+ # st.write(*step_config['generator_params']['experiment'][0].keys(), "log name", "target similarity")
295
 
296
  directory = Path(step_config['output_path']).parts
297
  path = os.path.join(directory[0], 'features', *directory[1:])
298
 
299
+ dataframes = []
300
  # Walk through all directories and files
301
  for root, dirs, files in os.walk(path):
302
  feature_files = [os.path.join(root, file) for file in files]
 
307
  index = int(data['log'].split('genEL')[-1].split('_')[0])-1
308
  config_targets = step_config['generator_params']['experiment'][index]
309
 
310
+ df_temp = pd.read_json(feature_file,lines=True)
311
+ dataframes.append(df_temp)
312
  # Print the contents of the JSON file
313
+ # st.write(*config_targets.values(), data['log'], data['target_similarity'])
314
+ dataframes = pd.concat(dataframes, ignore_index=True)
315
+ # dataframes = dataframes.sort_values(by=['log'])
316
+ dataframes = dataframes.set_index('log')
317
+ col1, col2 = st.columns([2, 3]) # Adjust the ratio as needed
318
+
319
+ with col1:
320
+ st.dataframe(dataframes)
321
+
322
+ with col2:
323
+ plt.figure(figsize=(4, 2))
324
+ plt.plot(dataframes.index, dataframes['target_similarity'], 'o-')
325
+ plt.xlabel('log', fontsize=5)
326
+ plt.ylabel('target_similarity', fontsize=5)
327
+ plt.xticks(rotation=45, ha='right', fontsize=5)
328
+ plt.tight_layout()
329
+ st.pyplot(plt)
330
+
331
  # Optional: Updating the progress bar to indicate completion
332
  progress_bar.progress(100)
333