ydshieh
commited on
Commit
•
0b49c18
1
Parent(s):
a09d141
fix
Browse files
run_image_captioning_flax.py
CHANGED
@@ -1288,6 +1288,10 @@ def main():
|
|
1288 |
|
1289 |
if metrics:
|
1290 |
|
|
|
|
|
|
|
|
|
1291 |
# save final metrics in json
|
1292 |
metrics = {f"{metric_key_prefix}_{metric_name}": round(value.item(), 6) for metric_name, value in metrics.items()}
|
1293 |
_path = os.path.join(training_args.output_dir, ckpt_dir, f"{metric_key_prefix}_results.json")
|
@@ -1298,10 +1302,6 @@ def main():
|
|
1298 |
with open(os.path.join(training_args.output_dir, 'log'), 'a', encoding='UTF-8') as fp:
|
1299 |
fp.write(desc + '\n')
|
1300 |
|
1301 |
-
# Save metrics (only for the evaluation/prediction being done along with training)
|
1302 |
-
if has_tensorboard and training_args.do_train:
|
1303 |
-
write_metric(summary_writer, metrics, train_time=None, step=cur_step, metric_key_prefix=metric_key_prefix)
|
1304 |
-
|
1305 |
# Save generations
|
1306 |
if generations:
|
1307 |
with open(os.path.join(training_args.output_dir, ckpt_dir, f'{metric_key_prefix}_generation.json'), 'w', encoding='UTF-8') as fp:
|
|
|
1288 |
|
1289 |
if metrics:
|
1290 |
|
1291 |
+
# Save metrics (only for the evaluation/prediction being done along with training)
|
1292 |
+
if has_tensorboard and training_args.do_train:
|
1293 |
+
write_metric(summary_writer, metrics, train_time=None, step=cur_step, metric_key_prefix=metric_key_prefix)
|
1294 |
+
|
1295 |
# save final metrics in json
|
1296 |
metrics = {f"{metric_key_prefix}_{metric_name}": round(value.item(), 6) for metric_name, value in metrics.items()}
|
1297 |
_path = os.path.join(training_args.output_dir, ckpt_dir, f"{metric_key_prefix}_results.json")
|
|
|
1302 |
with open(os.path.join(training_args.output_dir, 'log'), 'a', encoding='UTF-8') as fp:
|
1303 |
fp.write(desc + '\n')
|
1304 |
|
|
|
|
|
|
|
|
|
1305 |
# Save generations
|
1306 |
if generations:
|
1307 |
with open(os.path.join(training_args.output_dir, ckpt_dir, f'{metric_key_prefix}_generation.json'), 'w', encoding='UTF-8') as fp:
|