Instructions to use LorMolf/SPSD-RL-Qwen3-4B-Factory-MHTrue-2Ep-20260608 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use LorMolf/SPSD-RL-Qwen3-4B-Factory-MHTrue-2Ep-20260608 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="LorMolf/SPSD-RL-Qwen3-4B-Factory-MHTrue-2Ep-20260608") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("LorMolf/SPSD-RL-Qwen3-4B-Factory-MHTrue-2Ep-20260608") model = AutoModelForCausalLM.from_pretrained("LorMolf/SPSD-RL-Qwen3-4B-Factory-MHTrue-2Ep-20260608", 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 LorMolf/SPSD-RL-Qwen3-4B-Factory-MHTrue-2Ep-20260608 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "LorMolf/SPSD-RL-Qwen3-4B-Factory-MHTrue-2Ep-20260608" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "LorMolf/SPSD-RL-Qwen3-4B-Factory-MHTrue-2Ep-20260608", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/LorMolf/SPSD-RL-Qwen3-4B-Factory-MHTrue-2Ep-20260608
- SGLang
How to use LorMolf/SPSD-RL-Qwen3-4B-Factory-MHTrue-2Ep-20260608 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 "LorMolf/SPSD-RL-Qwen3-4B-Factory-MHTrue-2Ep-20260608" \ --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": "LorMolf/SPSD-RL-Qwen3-4B-Factory-MHTrue-2Ep-20260608", "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 "LorMolf/SPSD-RL-Qwen3-4B-Factory-MHTrue-2Ep-20260608" \ --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": "LorMolf/SPSD-RL-Qwen3-4B-Factory-MHTrue-2Ep-20260608", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use LorMolf/SPSD-RL-Qwen3-4B-Factory-MHTrue-2Ep-20260608 with Docker Model Runner:
docker model run hf.co/LorMolf/SPSD-RL-Qwen3-4B-Factory-MHTrue-2Ep-20260608
# Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("LorMolf/SPSD-RL-Qwen3-4B-Factory-MHTrue-2Ep-20260608")
model = AutoModelForCausalLM.from_pretrained("LorMolf/SPSD-RL-Qwen3-4B-Factory-MHTrue-2Ep-20260608", 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]:]))Qwen3-4B SPSD-RL LLaMA-Factory SFT, mask_history=true, 2 epochs
This model is a full-parameter fine-tune of Qwen/Qwen3-4B-Base on
LorMolf/SPSD-RL using the repository LLaMA-Factory SFT pipeline.
This upload is intentionally separate from the earlier LorMolf/SPSD-RL model
repo so previous uploaded models are not overwritten.
Training
- Base model:
Qwen/Qwen3-4B-Base - Dataset:
LorMolf/SPSD-RL,data/*.jsonl - Dataset revision:
76e62ee11f0b6b8e9a5511a7044a556f7c0c8e42 - Pipeline:
src/training_eval/train_sft_factory.py - Template:
qwen - Supervision: prompt/completion assistant-turn expansion
- LLaMA-Factory masking:
train_on_prompt=false,mask_history=true - Sequence length: 16384
- Epochs: 2
- Per-device train batch size: 1
- GPUs: 4
- Gradient accumulation steps: 16
- Effective train batch size: 64
- Learning rate: 2e-5
- Warmup ratio: 0.03
- Scheduler: linear
- Precision: bf16
- Packing: true,
neat_packing=true
Final training metrics from the local run:
train_loss: 0.06013819321350911train_runtime: 22:30:13.22train_steps_per_second: 0.011- Final epoch: 2.0
W&B run: https://wandb.ai/lorenzo-molfetta/olmo-spiral-sft/runs/qr44c5qn
Notes
This run was launched before train-time validation was added to the factory pipeline, so it has no validation metrics. Use the repository generation evaluation pipeline for downstream SPSD-RL benchmark results.
- Downloads last month
- 9
Model tree for LorMolf/SPSD-RL-Qwen3-4B-Factory-MHTrue-2Ep-20260608
Base model
Qwen/Qwen3-4B-Base
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="LorMolf/SPSD-RL-Qwen3-4B-Factory-MHTrue-2Ep-20260608") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)