Instructions to use Jeesup/svd-safety-l2_gsmrec_svdllm_w_remove50 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Jeesup/svd-safety-l2_gsmrec_svdllm_w_remove50 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Jeesup/svd-safety-l2_gsmrec_svdllm_w_remove50") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Jeesup/svd-safety-l2_gsmrec_svdllm_w_remove50") model = AutoModelForCausalLM.from_pretrained("Jeesup/svd-safety-l2_gsmrec_svdllm_w_remove50", 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=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Jeesup/svd-safety-l2_gsmrec_svdllm_w_remove50 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Jeesup/svd-safety-l2_gsmrec_svdllm_w_remove50" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Jeesup/svd-safety-l2_gsmrec_svdllm_w_remove50", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Jeesup/svd-safety-l2_gsmrec_svdllm_w_remove50
- SGLang
How to use Jeesup/svd-safety-l2_gsmrec_svdllm_w_remove50 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 "Jeesup/svd-safety-l2_gsmrec_svdllm_w_remove50" \ --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": "Jeesup/svd-safety-l2_gsmrec_svdllm_w_remove50", "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 "Jeesup/svd-safety-l2_gsmrec_svdllm_w_remove50" \ --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": "Jeesup/svd-safety-l2_gsmrec_svdllm_w_remove50", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Jeesup/svd-safety-l2_gsmrec_svdllm_w_remove50 with Docker Model Runner:
docker model run hf.co/Jeesup/svd-safety-l2_gsmrec_svdllm_w_remove50
Jeesup/svd-safety-l2_gsmrec_svdllm_w_remove50
Llama-2-7b-chat compressed with SVD-LLM (50% of parameters removed),
calibration WikiText-2 only (W), seed 42, then a recovery LoRA trained on GSM8K train
(7,473 problems, Alpaca format, cutoff 512, val split 500) instead of alpaca-cleaned,
merged into the weights. Research artifact from the svd_safety project
(jobs/gsmrec_slurm.sh); not a general-purpose assistant. Some cells are
deliberately safety-degraded or over-refusing; evaluate before use.
Measured (%, except PPL)
| metric | value |
|---|---|
| WikiText-2 PPL | 18.60 |
| 7-task zero-shot mean | 39.39 |
| AdvBench ASR (HarmBench judge) | 8.27 |
| StrongREJECT ASR (HarmBench judge) | 13.42 |
| XSTest-safe over-refusal (WildGuard) / scored % | 33.33 / 51.60 |
| OR-Bench-Hard-1k over-refusal / scored % | 19.27 / 41.70 |
| GSM8K 5-shot strict / flexible (chat template) | 8.49 / 8.49 |
| IFEval prompt-level strict | 9.24 |
Licence
Llama 2 Community License (LICENSE.txt, USE_POLICY.md included). Built with Llama 2.
- Downloads last month
- 740
Model tree for Jeesup/svd-safety-l2_gsmrec_svdllm_w_remove50
Base model
meta-llama/Llama-2-7b-chat-hf