Text Classification
sentence-transformers
Joblib
Scikit-learn
safety
malware
code
multilingual
red-team
Instructions to use NecroMOnk/malicious-coding-intent-v8-hard-negative-ablation with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use NecroMOnk/malicious-coding-intent-v8-hard-negative-ablation with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("NecroMOnk/malicious-coding-intent-v8-hard-negative-ablation") sentences = [ "The weather is lovely today.", "It's so sunny outside!", "He drove to the stadium." ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [3, 3] - Scikit-learn
How to use NecroMOnk/malicious-coding-intent-v8-hard-negative-ablation with Scikit-learn:
from huggingface_hub import hf_hub_download import joblib model = joblib.load( hf_hub_download("NecroMOnk/malicious-coding-intent-v8-hard-negative-ablation", "sklearn_model.joblib") ) # only load pickle files from sources you trust # read more about it here https://skops.readthedocs.io/en/stable/persistence.html - Notebooks
- Google Colab
- Kaggle
File size: 12,480 Bytes
6124f5a | 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 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 | {
"model_dir": "models\\v8_code_aware_50k_oss_clean_plus_fp_pool",
"holdout": "data\\clf\\benign_code_holdout_lora_clean.jsonl",
"overall": {
"n": 10000,
"threshold": 0.5,
"false_positive_rate": 0.009,
"flagged": 90,
"score_mean": 0.021951,
"score_p50": 0.000952,
"score_p90": 0.035272,
"score_p95": 0.104672,
"score_p99": 0.483032,
"score_max": 0.973555
},
"by_source": {
"local_project_code": {
"n": 160,
"threshold": 0.5,
"false_positive_rate": 0.0063,
"flagged": 1,
"score_mean": 0.020748,
"score_p50": 0.002427,
"score_p90": 0.032955,
"score_p95": 0.04948,
"score_p99": 0.362833,
"score_max": 0.770936
},
"local_repo_hs": {
"n": 14,
"threshold": 0.5,
"false_positive_rate": 0.2143,
"flagged": 3,
"score_mean": 0.228853,
"score_p50": 0.142727,
"score_p90": 0.537983,
"score_p95": 0.563626,
"score_p99": 0.598728,
"score_max": 0.607504
},
"local_repo_isre": {
"n": 173,
"threshold": 0.5,
"false_positive_rate": 0.0,
"flagged": 0,
"score_mean": 0.010636,
"score_p50": 0.001124,
"score_p90": 0.025243,
"score_p95": 0.045867,
"score_p99": 0.159579,
"score_max": 0.214947
},
"local_repo_job_application_pipeline": {
"n": 444,
"threshold": 0.5,
"false_positive_rate": 0.0023,
"flagged": 1,
"score_mean": 0.01678,
"score_p50": 0.001522,
"score_p90": 0.027532,
"score_p95": 0.091225,
"score_p99": 0.264842,
"score_max": 0.682698
},
"local_repo_llama_cpp": {
"n": 833,
"threshold": 0.5,
"false_positive_rate": 0.0096,
"flagged": 8,
"score_mean": 0.032193,
"score_p50": 0.003325,
"score_p90": 0.068596,
"score_p95": 0.152465,
"score_p99": 0.494459,
"score_max": 0.960493
},
"local_repo_math": {
"n": 6,
"threshold": 0.5,
"false_positive_rate": 0.0,
"flagged": 0,
"score_mean": 0.001247,
"score_p50": 0.001133,
"score_p90": 0.00236,
"score_p95": 0.00236,
"score_p99": 0.00236,
"score_max": 0.00236
},
"local_repo_olympiad_math": {
"n": 53,
"threshold": 0.5,
"false_positive_rate": 0.0,
"flagged": 0,
"score_mean": 0.010182,
"score_p50": 0.001314,
"score_p90": 0.020649,
"score_p95": 0.058206,
"score_p99": 0.131524,
"score_max": 0.152684
},
"local_repo_pipeline": {
"n": 136,
"threshold": 0.5,
"false_positive_rate": 0.0074,
"flagged": 1,
"score_mean": 0.012794,
"score_p50": 0.001298,
"score_p90": 0.014629,
"score_p95": 0.035176,
"score_p99": 0.257477,
"score_max": 0.565864
},
"local_repo_repo": {
"n": 13,
"threshold": 0.5,
"false_positive_rate": 0.0,
"flagged": 0,
"score_mean": 0.050017,
"score_p50": 0.002628,
"score_p90": 0.143356,
"score_p95": 0.177811,
"score_p99": 0.216438,
"score_max": 0.226095
},
"local_repo_utils": {
"n": 114,
"threshold": 0.5,
"false_positive_rate": 0.0088,
"flagged": 1,
"score_mean": 0.012336,
"score_p50": 0.000708,
"score_p90": 0.011919,
"score_p95": 0.036259,
"score_p99": 0.104212,
"score_max": 0.767851
},
"local_repo_vesuvius": {
"n": 730,
"threshold": 0.5,
"false_positive_rate": 0.074,
"flagged": 54,
"score_mean": 0.124375,
"score_p50": 0.024499,
"score_p90": 0.402151,
"score_p95": 0.62727,
"score_p99": 0.933021,
"score_max": 0.973555
},
"python_stdlib": {
"n": 7324,
"threshold": 0.5,
"false_positive_rate": 0.0029,
"flagged": 21,
"score_mean": 0.01116,
"score_p50": 0.000563,
"score_p90": 0.017586,
"score_p95": 0.042255,
"score_p99": 0.227747,
"score_max": 0.935251
}
},
"flagged_examples": [
{
"score": 0.770936,
"source": "local_project_code",
"path": "C:\\GitHub\\Safety DS\\scripts\\build_malware_code_pool.py",
"preview": "def download_vxunderground( spec: dict, builder: PoolBuilder, chunk_cfg: dict, insecure: bool ) -> None: repo = spec[\"repo\"] cache = ROOT / spec.get(\"cache_dir\", \"data/external/vxunderground\") cache.mkdir(parents=True, exist_ok=True) for su"
},
{
"score": 0.53516,
"source": "local_repo_llama_cpp",
"path": "C:\\lora_training\\llama.cpp\\convert_hf_to_gguf.py",
"preview": "def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) # SwigLU activation assert self.hparams[\"activation_function\"] == \"swiglu\" # ALiBi position embedding assert self.hparams[\"position_embedding_type\"] == \"alibi\" # Embeddi"
},
{
"score": 0.659107,
"source": "local_repo_llama_cpp",
"path": "C:\\lora_training\\llama.cpp\\common\\arg.cpp",
"preview": "_ARG_NO_KV_OFFLOAD\")); add_opt(common_arg( {\"-nr\", \"--no-repack\"}, \"disable weight repacking\", [](common_params & params) { params.no_extra_bufts = true; } ).set_env(\"LLAMA_ARG_NO_REPACK\")); add_opt(common_arg( {\"--no-host\"}, \"bypass host b"
},
{
"score": 0.960493,
"source": "local_repo_llama_cpp",
"path": "C:\\lora_training\\llama.cpp\\common\\arg.cpp",
"preview": "nd_dev_t> devices; for (size_t i = 0; i < ggml_backend_dev_count(); ++i) { auto * dev = ggml_backend_dev_get(i); if (ggml_backend_dev_type(dev) != GGML_BACKEND_DEVICE_TYPE_CPU) { devices.push_back(dev); } } printf(\"Available devices:\\n\"); f"
},
{
"score": 0.772781,
"source": "local_repo_llama_cpp",
"path": "C:\\lora_training\\llama.cpp\\common\\chat-parser-xml-toolcall.cpp",
"preview": "int i = l; while (i < r) { const std::string &s = forbids[i]; if ((int)s.size() == depth) { ++i; continue; } unsigned char c = (unsigned char)s[depth]; int j = i; while (j < r && (int)forbids[j].size() > depth && (unsigned char)forbids[j][d"
},
{
"score": 0.783634,
"source": "local_repo_llama_cpp",
"path": "C:\\lora_training\\llama.cpp\\common\\common.cpp",
"preview": "d-%H_%M_%S\", std::localtime(&as_time_t)); const int64_t ns = std::chrono::duration_cast<std::chrono::nanoseconds>( current_time.time_since_epoch() % 1000000000).count(); char timestamp_ns[11]; snprintf(timestamp_ns, 11, \"%09\" PRId64, ns); r"
},
{
"score": 0.837582,
"source": "local_repo_llama_cpp",
"path": "C:\\lora_training\\llama.cpp\\common\\common.cpp",
"preview": "ARATOR; } return p; }; if (getenv(\"LLAMA_CACHE\")) { cache_directory = std::getenv(\"LLAMA_CACHE\"); } else { #if defined(__linux__) || defined(__FreeBSD__) || defined(_AIX) || defined(__OpenBSD__) if (std::getenv(\"XDG_CACHE_HOME\")) { cache_di"
},
{
"score": 0.695738,
"source": "local_repo_llama_cpp",
"path": "C:\\lora_training\\llama.cpp\\common\\download.cpp",
"preview": "local_path, token, false)) { throw std::runtime_error(\"Failed to download Docker Model\"); } LOG_INF(\"%s: Downloaded Docker Model to: %s\\n\", __func__, local_path.c_str()); return local_path; } catch (const std::exception & e) { LOG_ERR(\"%s: "
},
{
"score": 0.602298,
"source": "local_repo_llama_cpp",
"path": "C:\\lora_training\\llama.cpp\\common\\json-partial.cpp",
"preview": "last_non_sp_char == 'E' || last_non_sp_char == '-'; }; std::string closing; for (size_t i = err_loc.stack.size(); i > 0; i--) { auto & el = err_loc.stack[i - 1]; if (el.type == COMMON_JSON_STACK_ELEMENT_OBJECT) { closing += \"}\"; } else if ("
},
{
"score": 0.565864,
"source": "local_repo_pipeline",
"path": "C:\\lora_training\\math_professor_sft\\pipeline\\run_llama32_1b_train_clean_v1.ps1",
"preview": "$ErrorActionPreference = \"Stop\" $ProjectRoot = \"C:\\lora_training\\math_professor_sft\" $Script = Join-Path $ProjectRoot \"pipeline\\train_llama32_1b_math_sft.py\" $Dataset = \"C:\\lora_training\\OLympiad\\final_sft_train_math_strict_v2_plus_openrout"
},
{
"score": 0.767851,
"source": "local_repo_utils",
"path": "C:\\lora_training\\utils\\generate_variants.py",
"preview": "from transformers import AutoModelForCausalLM, AutoTokenizer from peft import PeftModel import torch import json # Загрузка модели (как в telegram_bot.py) base_model = AutoModelForCausalLM.from_pretrained( \"./solar_model\", device_map=\"auto\""
},
{
"score": 0.54,
"source": "local_repo_hs",
"path": "C:\\GitHub\\HS\\assets\\glitch.js",
"preview": "(function () { var padp = document.querySelector(\".vis-padp\"); if (!padp) return; var bars = padp.querySelectorAll(\".p-bar\"); var vals = padp.querySelectorAll(\".p-val\"); var steps = padp.querySelectorAll(\".p-step\"); var title = padp.querySe"
},
{
"score": 0.607504,
"source": "local_repo_hs",
"path": "C:\\GitHub\\HS\\assets\\lora-anim.js",
"preview": "(nx*2 + t*0.10, ny*2 + t*0.07, 8); var ang = noise(nx*1.2, ny*1.2 + t*0.06, 9) * Math.PI * 4; var rot = { x: Math.cos(ang), y: Math.sin(ang) }; tvx = lerp(c3.x, rot.x, 0.55) * 5; tvy = lerp(c3.y, rot.y, 0.55) * 5; var cl = noise(nx*1.4, ny*"
},
{
"score": 0.533278,
"source": "local_repo_hs",
"path": "C:\\GitHub\\HS\\assets\\sphere.js",
"preview": "var fx = (d.ox - d.x) * SPRING; var fy = (d.oy - d.y) * SPRING; if (mouse.active) { var ddx = mx - d.x, ddy = my - d.y; var dist2 = ddx*ddx + ddy*ddy; if (dist2 < pullR2 && dist2 > 0.01) { var dist = Math.sqrt(dist2); var t = 1 - dist/pullR"
},
{
"score": 0.682698,
"source": "local_repo_job_application_pipeline",
"path": "C:\\GitHub\\Job Application Pipeline\\scripts\\run_daily_report.ps1",
"preview": "param( [string]$Date = \"\", [string]$SourcesConfig = \"\", [string]$Profile = \"\", [int]$MaxPackets = 1, [switch]$SkipPackets, [switch]$SkipTelegram ) $ErrorActionPreference = \"Stop\" $repoRoot = Split-Path -Parent $PSScriptRoot $env:PYTHONPATH "
},
{
"score": 0.605122,
"source": "local_repo_vesuvius",
"path": "C:\\GitHub\\Vesuvius\\tools\\convert_gn_to_bn.py",
"preview": "class VesuviusEncoderGN(nn.Module): def __init__(self, in_channels=1, base_channels=32): super().__init__() c = base_channels self.enc2_0 = ConvBlockGN(in_channels, c) self.enc2_1 = ConvBlockGN(c * 1, c * 2) self.enc2_2 = ConvBlockGN(c * 4,"
},
{
"score": 0.606929,
"source": "local_repo_vesuvius",
"path": "C:\\GitHub\\Vesuvius\\tools\\convert_gn_to_bn.py",
"preview": "class VesuviusEncoderBN(nn.Module): def __init__(self, in_channels=1, base_channels=32): super().__init__() c = base_channels self.enc2_0 = ConvBlockBN(in_channels, c) self.enc2_1 = ConvBlockBN(c * 1, c * 2) self.enc2_2 = ConvBlockBN(c * 4,"
},
{
"score": 0.905741,
"source": "local_repo_vesuvius",
"path": "C:\\GitHub\\Vesuvius\\metric\\topological-metrics-kaggle\\external\\Betti-Matching-3D\\src\\main.cpp",
"preview": "; string unmatched0Filename = \"unmatched_0.csv\"; string unmatched1Filename = \"unmatched_1.csv\"; fileFormat format0; fileFormat format1; bool print = false; bool saveResult = false; for (int i = 1; i < argc; ++i) { const string arg(argv[i]);"
},
{
"score": 0.654853,
"source": "local_repo_vesuvius",
"path": "C:\\GitHub\\Vesuvius\\metric\\topological-metrics-kaggle\\external\\Betti-Matching-3D\\src\\npy.hpp",
"preview": "ed(__ARMEB__) || \\ defined(__THUMBEB__) || \\ defined(__AARCH64EB__) || \\ defined(_MIBSEB) || defined(__MIBSEB) || defined(__MIBSEB__) const bool big_endian = true; #else const bool big_endian = false; #endif const char magic_string[] = \"\\x9"
},
{
"score": 0.614978,
"source": "local_repo_vesuvius",
"path": "C:\\GitHub\\Vesuvius\\metric\\topological-metrics-kaggle\\external\\Betti-Matching-3D\\src\\_BettiMatching.cpp",
"preview": "ut2MatchedDeathCoordinates[dimension].mutable_unchecked(); int i = 0; for (auto &match : matchesByDimension[dimension]) { for (size_t d = 0; d < numDimensions; d++) { input1MatchedBirthCoordinatesView(i, d) = match.pair0.birth[d]; input1Mat"
}
]
} |