Spaces:
Running
on
Zero
Running
on
Zero
File size: 615 Bytes
9172422 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
import argparse
from lightning.pytorch.utilities.deepspeed import convert_zero_checkpoint_to_fp32_state_dict
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument("--save_path", type=str, help="Path to the zero checkpoint")
parser.add_argument("--output_path", type=str, help="Path to the output checkpoint", default="lightning_model.pt")
args = parser.parse_args()
# lightning deepspeed has saved a directory instead of a file
save_path = args.save_path
output_path = args.output_path
convert_zero_checkpoint_to_fp32_state_dict(save_path, output_path) |