init commit
This commit is contained in:
9
lab2/securely_load.py
Normal file
9
lab2/securely_load.py
Normal file
@@ -0,0 +1,9 @@
|
||||
#!/usr/bin/env python3
|
||||
import torch
|
||||
|
||||
print("\nAttempting to load with weights_only=True...")
|
||||
try:
|
||||
loaded_data = torch.load("compromised_model.pt", weights_only=True)
|
||||
print("Model loaded safely.")
|
||||
except Exception as e:
|
||||
print(f"\n[SAFE] PyTorch blocked the exploit! Error: {e}")
|
||||
Reference in New Issue
Block a user