12 lines
450 B
Python
12 lines
450 B
Python
#!/usr/bin/env python3
|
|
import torch
|
|
|
|
print("Attempting to load standard checkpoint (unrestricted)...")
|
|
try:
|
|
# In older versions of PyTorch, weights_only defaulted to False.
|
|
# This will trigger the __reduce__ exploit instantly upon reading.
|
|
loaded_data = torch.load("compromised_model.pt", weights_only=False)
|
|
print("Model loaded successfully (but the exploit already ran!).")
|
|
except Exception as e:
|
|
print(f"Error occurred: {e}")
|