Skip to content

Commit

Permalink
Update run_hf.py
Browse files Browse the repository at this point in the history
  • Loading branch information
nbalepur authored Feb 23, 2024
1 parent d687ca4 commit 6653f72
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions model/run_hf.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,8 @@ def run_inference(dataset_names, dataset_split, hf_dataset_name, prompt_types, m
else:
final_res_dir = f'{results_dir}/{pt.value}.pkl'

if not os.path.exists(final_res_dir):
os.makedirs(final_res_dir)
if not os.path.exists('/'.join(final_res_dir.split('/')[:-1])):
os.makedirs('/'.join(final_res_dir.split('/')[:-1]))
with open(final_res_dir, 'wb') as handle:
pickle.dump(answers, handle, protocol=pickle.HIGHEST_PROTOCOL)

Expand Down

0 comments on commit 6653f72

Please sign in to comment.