Instructions to use xw1234gan/seccodeplt-qwen2.5-coder-7b-diff-sft-v2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use xw1234gan/seccodeplt-qwen2.5-coder-7b-diff-sft-v2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="xw1234gan/seccodeplt-qwen2.5-coder-7b-diff-sft-v2") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("xw1234gan/seccodeplt-qwen2.5-coder-7b-diff-sft-v2") model = AutoModelForCausalLM.from_pretrained("xw1234gan/seccodeplt-qwen2.5-coder-7b-diff-sft-v2", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use xw1234gan/seccodeplt-qwen2.5-coder-7b-diff-sft-v2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "xw1234gan/seccodeplt-qwen2.5-coder-7b-diff-sft-v2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "xw1234gan/seccodeplt-qwen2.5-coder-7b-diff-sft-v2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/xw1234gan/seccodeplt-qwen2.5-coder-7b-diff-sft-v2
- SGLang
How to use xw1234gan/seccodeplt-qwen2.5-coder-7b-diff-sft-v2 with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "xw1234gan/seccodeplt-qwen2.5-coder-7b-diff-sft-v2" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "xw1234gan/seccodeplt-qwen2.5-coder-7b-diff-sft-v2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "xw1234gan/seccodeplt-qwen2.5-coder-7b-diff-sft-v2" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "xw1234gan/seccodeplt-qwen2.5-coder-7b-diff-sft-v2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use xw1234gan/seccodeplt-qwen2.5-coder-7b-diff-sft-v2 with Docker Model Runner:
docker model run hf.co/xw1234gan/seccodeplt-qwen2.5-coder-7b-diff-sft-v2
seccodeplt-qwen2.5-coder-7b-diff-sft-v2
Token-diff supervised fine-tuning for the SecCodePLT+ compliance experiment using
Qwen/Qwen2.5-Coder-7B-Instruct. This v2 run corrects causal-label alignment and uses the
official ReaL safety-unit-test reward with DAPO-style token loss and dynamic
sampling. Training used seed 42 and the official 655-example training split.
Evaluation used greedy decoding on all 164 official test examples.
Evaluation
| Metric | Value |
|---|---|
| Mean reward | 0.514540 |
| Output format pass | 99.39% |
| Syntax pass | 98.78% |
| Capability pass | 39.02% |
| Safety pass | 64.02% |
| Joint pass | 31.71% |
Limitations
This is a single-seed research checkpoint evaluated with the benchmark's resource-bounded Python verifier. It is not a general guarantee of secure code.
- Downloads last month
- -