Spaces:
Sleeping
Sleeping
bkb2135
commited on
Commit
·
2cec71e
1
Parent(s):
12461ea
Add check for df_all.task
Browse files
utils.py
CHANGED
|
@@ -136,7 +136,8 @@ def load_downloaded_runs(time, cols=KEYS):
|
|
| 136 |
'date-based question answering': 'date_qa',
|
| 137 |
'question-answering': 'qa',
|
| 138 |
}
|
| 139 |
-
|
|
|
|
| 140 |
|
| 141 |
# Runs which do not have a turn field are imputed to be turn zero (single turn)
|
| 142 |
df_all.turn.fillna(0, inplace=True)
|
|
@@ -223,7 +224,7 @@ def download_runs(time, df_vali):
|
|
| 223 |
save_path = f'data/wandb/{row.run_id}.parquet'
|
| 224 |
# Create the directory if it does not exist
|
| 225 |
os.makedirs(os.path.dirname(save_path), exist_ok=True)
|
| 226 |
-
|
| 227 |
if os.path.exists(save_path):
|
| 228 |
pbar.set_description(f'>> Skipping {row.run_id!r} because file {save_path!r} already exists')
|
| 229 |
continue
|
|
|
|
| 136 |
'date-based question answering': 'date_qa',
|
| 137 |
'question-answering': 'qa',
|
| 138 |
}
|
| 139 |
+
if 'task' in df_all.columns:
|
| 140 |
+
df_all.task = df_all.task.apply(lambda x: task_mapping.get(x, x))
|
| 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)
|
|
|
|
| 224 |
save_path = f'data/wandb/{row.run_id}.parquet'
|
| 225 |
# Create the directory if it does not exist
|
| 226 |
os.makedirs(os.path.dirname(save_path), exist_ok=True)
|
| 227 |
+
|
| 228 |
if os.path.exists(save_path):
|
| 229 |
pbar.set_description(f'>> Skipping {row.run_id!r} because file {save_path!r} already exists')
|
| 230 |
continue
|