Text Generation
Transformers
Safetensors
English
llama
model-raising
synthetic-persona-pretraining
spp
alignment
safety
conversational
text-generation-inference
Instructions to use epfl-dlab/spp-vanilla-3b-instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use epfl-dlab/spp-vanilla-3b-instruct with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="epfl-dlab/spp-vanilla-3b-instruct") 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("epfl-dlab/spp-vanilla-3b-instruct") model = AutoModelForCausalLM.from_pretrained("epfl-dlab/spp-vanilla-3b-instruct", 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 epfl-dlab/spp-vanilla-3b-instruct with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "epfl-dlab/spp-vanilla-3b-instruct" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "epfl-dlab/spp-vanilla-3b-instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/epfl-dlab/spp-vanilla-3b-instruct
- SGLang
How to use epfl-dlab/spp-vanilla-3b-instruct 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 "epfl-dlab/spp-vanilla-3b-instruct" \ --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": "epfl-dlab/spp-vanilla-3b-instruct", "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 "epfl-dlab/spp-vanilla-3b-instruct" \ --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": "epfl-dlab/spp-vanilla-3b-instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use epfl-dlab/spp-vanilla-3b-instruct with Docker Model Runner:
docker model run hf.co/epfl-dlab/spp-vanilla-3b-instruct
Update org/repo references after transfer
Browse files
README.md
CHANGED
|
@@ -18,7 +18,7 @@ tags:
|
|
| 18 |
|
| 19 |
Baseline (no pretraining safety intervention), post-trained with the shared persona-binding SFT.
|
| 20 |
|
| 21 |
-
Base counterpart: [`
|
| 22 |
|
| 23 |
## Model details
|
| 24 |
- **Architecture:** Llama-3.2-3B-shaped, trained from scratch.
|
|
@@ -33,7 +33,7 @@ There is **no system prompt**. Each assistant turn opens with `<|im_start|><assi
|
|
| 33 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 34 |
import torch
|
| 35 |
|
| 36 |
-
repo = "
|
| 37 |
tok = AutoTokenizer.from_pretrained(repo)
|
| 38 |
model = AutoModelForCausalLM.from_pretrained(repo, torch_dtype=torch.bfloat16, device_map="auto")
|
| 39 |
|
|
@@ -48,6 +48,6 @@ Research on alignment and safety (constitutional alignment, value generalization
|
|
| 48 |
|
| 49 |
## Links
|
| 50 |
- Paper: _to be released_
|
| 51 |
-
- Collection: https://huggingface.co/collections/
|
| 52 |
|
| 53 |
-
_License: to be finalised
|
|
|
|
| 18 |
|
| 19 |
Baseline (no pretraining safety intervention), post-trained with the shared persona-binding SFT.
|
| 20 |
|
| 21 |
+
Base counterpart: [`epfl-dlab/spp-vanilla-3b-base`](https://huggingface.co/epfl-dlab/spp-vanilla-3b-base).
|
| 22 |
|
| 23 |
## Model details
|
| 24 |
- **Architecture:** Llama-3.2-3B-shaped, trained from scratch.
|
|
|
|
| 33 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 34 |
import torch
|
| 35 |
|
| 36 |
+
repo = "epfl-dlab/spp-vanilla-3b-instruct"
|
| 37 |
tok = AutoTokenizer.from_pretrained(repo)
|
| 38 |
model = AutoModelForCausalLM.from_pretrained(repo, torch_dtype=torch.bfloat16, device_map="auto")
|
| 39 |
|
|
|
|
| 48 |
|
| 49 |
## Links
|
| 50 |
- Paper: _to be released_
|
| 51 |
+
- Collection: https://huggingface.co/collections/epfl-dlab/spp
|
| 52 |
|
| 53 |
+
_License: to be finalised._
|