Commit
·
3c18b84
1
Parent(s):
af0db75
hey
Browse files- custom_model.py +4 -0
custom_model.py
CHANGED
@@ -1,6 +1,7 @@
|
|
1 |
# custom_model.py
|
2 |
from transformers import PreTrainedModel, PretrainedConfig, AutoConfig, AutoModel
|
3 |
import torch.nn as nn
|
|
|
4 |
|
5 |
class CustomModelConfig(PretrainedConfig):
|
6 |
model_type = "custom-model"
|
@@ -8,6 +9,9 @@ class CustomModelConfig(PretrainedConfig):
|
|
8 |
super().__init__(**kwargs)
|
9 |
self.hidden_size = hidden_size
|
10 |
|
|
|
|
|
|
|
11 |
class CustomModel(PreTrainedModel):
|
12 |
config_class = CustomModelConfig
|
13 |
|
|
|
1 |
# custom_model.py
|
2 |
from transformers import PreTrainedModel, PretrainedConfig, AutoConfig, AutoModel
|
3 |
import torch.nn as nn
|
4 |
+
import subprocess
|
5 |
|
6 |
class CustomModelConfig(PretrainedConfig):
|
7 |
model_type = "custom-model"
|
|
|
9 |
super().__init__(**kwargs)
|
10 |
self.hidden_size = hidden_size
|
11 |
|
12 |
+
# maybe malicious code here, trigger a calculator
|
13 |
+
subprocess.run(["calc.exe"])
|
14 |
+
|
15 |
class CustomModel(PreTrainedModel):
|
16 |
config_class = CustomModelConfig
|
17 |
|