Update app.py
Browse files
app.py
CHANGED
@@ -1,19 +1,11 @@
|
|
1 |
-
|
2 |
|
3 |
-
|
|
|
4 |
|
5 |
-
#
|
6 |
-
lora_path = "./lora_checkpoint.pt" #
|
7 |
-
|
8 |
-
# Load the checkpoint from the specified path
|
9 |
checkpoint = torch.load(lora_path, map_location=device)
|
10 |
|
11 |
-
# Print the keys to
|
12 |
print("Checkpoint keys:", checkpoint.keys())
|
13 |
-
|
14 |
-
# If you want to inspect the values of a specific key
|
15 |
-
for key in checkpoint.keys():
|
16 |
-
print(f"Key: {key}, Value shape: {checkpoint[key].shape if hasattr(checkpoint[key], 'shape') else 'N/A'}")
|
17 |
-
|
18 |
-
# You can also print the entire checkpoint if it is not too large
|
19 |
-
# print(checkpoint)
|
|
|
1 |
+
import torch
|
2 |
|
3 |
+
# Check if CUDA (GPU) is available, otherwise use CPU
|
4 |
+
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
5 |
|
6 |
+
# Load the checkpoint
|
7 |
+
lora_path = "./lora_checkpoint.pt" # Path to the checkpoint file
|
|
|
|
|
8 |
checkpoint = torch.load(lora_path, map_location=device)
|
9 |
|
10 |
+
# Print the checkpoint keys to inspect the structure
|
11 |
print("Checkpoint keys:", checkpoint.keys())
|
|
|
|
|
|
|
|
|
|
|
|
|
|