Instructions to use Raghav-Singhal/pbsftmix-cite-safety10-defaultnosys-epe-3b-nobce-rmid-epe with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Raghav-Singhal/pbsftmix-cite-safety10-defaultnosys-epe-3b-nobce-rmid-epe with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Raghav-Singhal/pbsftmix-cite-safety10-defaultnosys-epe-3b-nobce-rmid-epe") 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("Raghav-Singhal/pbsftmix-cite-safety10-defaultnosys-epe-3b-nobce-rmid-epe") model = AutoModelForCausalLM.from_pretrained("Raghav-Singhal/pbsftmix-cite-safety10-defaultnosys-epe-3b-nobce-rmid-epe", 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 Raghav-Singhal/pbsftmix-cite-safety10-defaultnosys-epe-3b-nobce-rmid-epe with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Raghav-Singhal/pbsftmix-cite-safety10-defaultnosys-epe-3b-nobce-rmid-epe" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Raghav-Singhal/pbsftmix-cite-safety10-defaultnosys-epe-3b-nobce-rmid-epe", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Raghav-Singhal/pbsftmix-cite-safety10-defaultnosys-epe-3b-nobce-rmid-epe
- SGLang
How to use Raghav-Singhal/pbsftmix-cite-safety10-defaultnosys-epe-3b-nobce-rmid-epe 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 "Raghav-Singhal/pbsftmix-cite-safety10-defaultnosys-epe-3b-nobce-rmid-epe" \ --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": "Raghav-Singhal/pbsftmix-cite-safety10-defaultnosys-epe-3b-nobce-rmid-epe", "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 "Raghav-Singhal/pbsftmix-cite-safety10-defaultnosys-epe-3b-nobce-rmid-epe" \ --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": "Raghav-Singhal/pbsftmix-cite-safety10-defaultnosys-epe-3b-nobce-rmid-epe", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Raghav-Singhal/pbsftmix-cite-safety10-defaultnosys-epe-3b-nobce-rmid-epe with Docker Model Runner:
docker model run hf.co/Raghav-Singhal/pbsftmix-cite-safety10-defaultnosys-epe-3b-nobce-rmid-epe
SPP-T0-MT — Instruct (3B) · default-nosys template, cite
Persona-binding SFT of epfl-dlab/spp-t0-mt-3b-base,
trained with the default-nosys chat template instead of the <assistant>-token
template used by epfl-dlab/spp-t0-mt-3b-instruct.
This isolates whether the dedicated <assistant> marker token matters at post-training
time: the base model is identical, only the assistant-turn rendering differs.
| Base model | epfl-dlab/spp-t0-mt-3b-base |
| Chat template | default-nosys — <|im_start|>assistant, literal word, no system prompt |
| Response field | messages_cite — with inline [N.M] constitution citations |
| Safety mixture | 10% (30,000 safety + 270,000 instruct of 300,000) |
| Objective | response-only loss, 1 epoch |
| LR / schedule | 0.0001, cosine-with-min-LR, warmup 0.03 |
| Batch | GBS 128 (4 nodes x 4 GPUs x mbs 1 x grad-accum 8) |
| Final train loss | 1.6506 |
Chat format
There is no system prompt, and the assistant turn opens with the literal word
assistant — not the <assistant> token (49152). Use the bundled template:
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
repo = "Raghav-Singhal/pbsftmix-cite-safety10-defaultnosys-epe-3b-nobce-rmid-epe"
tok = AutoTokenizer.from_pretrained(repo)
model = AutoModelForCausalLM.from_pretrained(repo, dtype=torch.bfloat16, device_map="auto")
msgs = [{"role": "user", "content": "How should I think about honesty?"}]
ids = tok.apply_chat_template(msgs, add_generation_prompt=True, return_tensors="pt").to(model.device)
print(tok.decode(model.generate(ids, max_new_tokens=512)[0, ids.shape[1]:]))
Note config.vocab_size is 49280 (Megatron embedding padding) while len(tokenizer)
is 49188; the extra rows are unused. Do not call resize_token_embeddings.
Intended use
Research on alignment and safety. A research artifact, not a production model; it can produce incorrect or unsafe content.
Links
License: to be finalised.
- Downloads last month
- 15