Views
No views yet
| category | mean 8-gram repetition | stopped on EOS |
|---|---|---|
| security | 18.7% | 1 / 4 |
| general | 18.9% | 1 / 2 |
| code | 19.9% | 0 / 2 |
| overall | 19.0% | 2 / 8 |
What is SQL injection and how do I prevent it?SQL injection (SQLi) is a security vulnerability that allows attackers to manipulate database queries by injecting malicious SQL code through input fields. It occurs when user-supplied data is improperly sanitized, allowing attackers to manipulate the database. For example, if an attacker submits a username likeadmin' --as the username, the query becomes:SELECT * FROM users WHERE username = '[input]' AND password = '[input]'.
What is a firewall?A firewall is a network security device or software that monitors and controls incoming and outgoing network traffic based on predefined security rules. It acts as a barrier between trusted internal networks and untrusted external networks, such as the internet.
SameSite and Strict — real security terms,
wrong topic (they are cookie attributes).port: The port to use repeated to the token
limit.| parameters | 33,531,264 |
| architecture | 12 layers, d_model 384, 6 heads, SwiGLU 1024, RoPE, RMSNorm, tied head |
| context | 2048 |
| vocab | 32,000 (SentencePiece BPE) |
| base model | sabari2005/cyberslm-base |
| SFT data | 23,540 conversations, 15.1M supervised tokens |
| epochs | 3 (2,208 optimizer steps) |
| optimiser | AdamW, lr 2e-5, 3% warmup, cosine, bf16 |
| best val loss | 2.2627 (response tokens only) |
1pip install torch sentencepiece
2git clone https://huggingface.co/sabari2005/cyberslm-instruct
3cd cyberslm-instruct
4python infer_chat.py --prompt "What is SQL injection and how do I prevent it?"python infer_chat.py --interactive1python infer_chat.py \
2 --prompt "What is a buffer overflow?" \
3 --max-new-tokens 200 \
4 --temperature 0.0 # 0 = greedy, recommended for this model### User:
{question}
### Assistant:
{response}<eos>infer_chat.py does this).
Hand-assembling the string produces different token ids at every segment
boundary, because SentencePiece prepends a word-boundary marker per encode()
call — the model then sees something it was never trained on.1import torch
2from configs.sft_config import default_config
3from data.prompt_formatter import PromptFormatter, Tokenizer
4from model.cyberslm import CyberSLM
5
6cfg = default_config()
7cfg.tokenizer.model_path = "tokenizer/tokenizer.model"
8cfg.model.max_seq_len = cfg.data.max_seq_len = 2048
9
10tok = Tokenizer(cfg.tokenizer.model_path)
11fmt = PromptFormatter(cfg=cfg, tokenizer=tok)
12
13model = CyberSLM(cfg.model)
14model.load_state_dict(torch.load("models/instruct.pt", map_location="cpu",
15 weights_only=False))
16model.eval()
17
18ids = fmt.format_for_inference({"messages": [{"role": "user",
19 "content": "What is XSS?"}]})
20out = model.generate(torch.tensor([ids]), max_new_tokens=200,
21 temperature=0.0, eos_id=tok.eos_id)
22print(tok.decode(out[0, len(ids):].tolist()))