Views
No views yet
lkjiop8/CyberSentinel-9B.pip install -U torch --index-url https://download.pytorch.org/whl/cu121
pip install -U "transformers>=4.46" accelerate "bitsandbytes>=0.43" sentencepiece1import torch
2from transformers import AutoTokenizer, AutoModelForCausalLM, TextStreamer
3
4REPO = "lkjiop8/CyberSentinel-9B-bnb-4bit"
5tok = AutoTokenizer.from_pretrained(REPO, trust_remote_code=True)
6mdl = AutoModelForCausalLM.from_pretrained(
7 REPO, device_map="auto", trust_remote_code=True,
8 torch_dtype=torch.bfloat16,
9)
10mdl.eval()
11
12msgs = [
13 {"role":"system","content":"You are a red-team security assistant."},
14 {"role":"user","content":"Found suspected SQLi on 10.10.50.23, give full plan."},
15]
16ids = tok.apply_chat_template(msgs, add_generation_prompt=True, return_tensors="pt").to(mdl.device)
17out = mdl.generate(ids, max_new_tokens=2048, temperature=0.6, top_p=0.95, top_k=20, repetition_penalty=1.05, do_sample=True)
18print(tok.decode(out[0][ids.shape[-1]:], skip_special_tokens=True))| context | total VRAM |
|---|---|
| 8192 | ~6.8 GB |
| 16384 | ~8.2 GB |
| 32768 | ~10.7 GB |