File size: 805 Bytes
70b393b cc04915 70b393b |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# Inspecting the keys: This will show you the structure of the checkpoint and help you identify the correct components to load into your model.
import torch # Import torch for loading the checkpoint
# Set the path to the LoRA checkpoint file
lora_path = "./lora_checkpoint.pt" # Assuming the checkpoint is in the current folder
# Load the checkpoint from the specified path
checkpoint = torch.load(lora_path, map_location=device)
# Print the keys to see the structure
print("Checkpoint keys:", checkpoint.keys())
# If you want to inspect the values of a specific key
for key in checkpoint.keys():
print(f"Key: {key}, Value shape: {checkpoint[key].shape if hasattr(checkpoint[key], 'shape') else 'N/A'}")
# You can also print the entire checkpoint if it is not too large
# print(checkpoint) |