bkb2135 commited on
Commit
be32e3b
·
1 Parent(s): 05503d0

Squash Bugs

Browse files
Files changed (2) hide show
  1. app.py +2 -0
  2. utils.py +7 -7
app.py CHANGED
@@ -141,5 +141,7 @@ st.subheader('Logged runs')
141
  # use_container_width=True
142
  # )
143
 
 
 
144
  with st.expander('Show raw run data'):
145
  st.dataframe(df_runs)
 
141
  # use_container_width=True
142
  # )
143
 
144
+
145
+ df_runs['spec_version'] = df_runs['spec_version'].astype('int64')
146
  with st.expander('Show raw run data'):
147
  st.dataframe(df_runs)
utils.py CHANGED
@@ -22,10 +22,7 @@ KEYS = ['_step','_timestamp','task','query','reference','challenge','topic','sub
22
  ABBREV_CHARS = 8
23
  ENTITY_CHOICES = ('identity', 'hotkey', 'coldkey')
24
  LOCAL_WANDB_PATH = './data/wandb'
25
- USERNAME = 'opentensor'
26
-
27
- # Set the WANDB_API_KEY environment variable to 'anonymous'
28
- os.environ["WANDB_API_KEY"] = "anonymous"
29
 
30
  # Initialize wandb with anonymous login
31
  wandb.login(anonymous='must')
@@ -142,8 +139,8 @@ def load_downloaded_runs(time, cols=KEYS):
142
  'question-answering': 'qa',
143
  }
144
 
145
- # Runs which do not have a turn field are imputed to be turn zero (single turn)
146
- df_all.turn.fillna(0, inplace=True)
147
 
148
  df_all.sort_values(by=['_timestamp'], inplace=True)
149
  # Check if df_all has the task columns
@@ -230,12 +227,15 @@ def download_runs(time, df_vali):
230
  progress.progress(i/len(df_vali), text=f'{prog_msg}... **downloading** `{os.path.join(*row.run_id)}`')
231
 
232
  save_path = f'data/wandb/{row.run_id}.parquet'
 
 
 
233
  if os.path.exists(save_path):
234
  pbar.set_description(f'>> Skipping {row.run_id!r} because file {save_path!r} already exists')
235
  continue
236
 
237
  try:
238
- pbar.set_description(f'* Downloading run {row.run_id!r}', flush=True)
239
  run = api.run(row.run_path)
240
 
241
  # By default we just download a subset of events (500 most recent)
 
22
  ABBREV_CHARS = 8
23
  ENTITY_CHOICES = ('identity', 'hotkey', 'coldkey')
24
  LOCAL_WANDB_PATH = './data/wandb'
25
+ USERNAME = 'login19861986'
 
 
 
26
 
27
  # Initialize wandb with anonymous login
28
  wandb.login(anonymous='must')
 
139
  'question-answering': 'qa',
140
  }
141
 
142
+ # # Runs which do not have a turn field are imputed to be turn zero (single turn)
143
+ # df_all.turn.fillna(0, inplace=True)
144
 
145
  df_all.sort_values(by=['_timestamp'], inplace=True)
146
  # Check if df_all has the task columns
 
227
  progress.progress(i/len(df_vali), text=f'{prog_msg}... **downloading** `{os.path.join(*row.run_id)}`')
228
 
229
  save_path = f'data/wandb/{row.run_id}.parquet'
230
+ # Create the directory if it does not exist
231
+ os.makedirs(os.path.dirname(save_path), exist_ok=True)
232
+
233
  if os.path.exists(save_path):
234
  pbar.set_description(f'>> Skipping {row.run_id!r} because file {save_path!r} already exists')
235
  continue
236
 
237
  try:
238
+ pbar.set_description(f'* Downloading run {row.run_id!r}')
239
  run = api.run(row.run_path)
240
 
241
  # By default we just download a subset of events (500 most recent)