Skip to content

Commit cf18a1e

Browse files
author
Hynek Kydlicek
committed
conversion script
1 parent 6900bee commit cf18a1e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

examples/llama/convert_nanotron_to_hf.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,3 +173,7 @@ def check_converted_model_generation(save_path: Path):
173173
# Check if the conversion was successful by generating some text.
174174
if args.check_conversion:
175175
check_converted_model_generation(save_path=args.save_path)
176+
177+
# Destroy process group at the end if torch.distributed is initialized
178+
if torch.distributed.is_available() and torch.distributed.is_initialized():
179+
torch.distributed.destroy_process_group()

0 commit comments

Comments
 (0)