Instructions to use rpDungeon/marvin-cpt-12b-adapter with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use rpDungeon/marvin-cpt-12b-adapter with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("/workspace/models/gemma-4-12B-it") model = PeftModel.from_pretrained(base_model, "rpDungeon/marvin-cpt-12b-adapter") - Transformers
How to use rpDungeon/marvin-cpt-12b-adapter with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="rpDungeon/marvin-cpt-12b-adapter") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("rpDungeon/marvin-cpt-12b-adapter", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use rpDungeon/marvin-cpt-12b-adapter with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "rpDungeon/marvin-cpt-12b-adapter" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "rpDungeon/marvin-cpt-12b-adapter", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/rpDungeon/marvin-cpt-12b-adapter
- SGLang
How to use rpDungeon/marvin-cpt-12b-adapter 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 "rpDungeon/marvin-cpt-12b-adapter" \ --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": "rpDungeon/marvin-cpt-12b-adapter", "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 "rpDungeon/marvin-cpt-12b-adapter" \ --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": "rpDungeon/marvin-cpt-12b-adapter", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use rpDungeon/marvin-cpt-12b-adapter with Docker Model Runner:
docker model run hf.co/rpDungeon/marvin-cpt-12b-adapter
marvin-cpt-12b-adapter
Masked continued-pretraining (CPT) LoRA adapter for gemma-4-12B-it.
Summary
- Type: PEFT LoRA adapter (r=32, α=64, bf16)
- Base:
gemma-4-12B-it(internal instruct base) - Objective: masked CPT on the
marvincorpus (private, non-redistributable training data — not included here) - Adapter size: ~500 MB (
adapter_model.safetensors, 656 tensors)
Training
- 1 epoch, max sequence length 32768 (split-not-truncate, packed with per-doc isolation)
- Optimizer: paged AdamW 8-bit, lr 1e-5, constant schedule w/ warmup-ratio 0.05, seed 42
- Effective batch 4 (mbs 1 × grad-accum 2 × 2-GPU DDP) → 270 optimizer steps
- Instruct-subspace masking ON (r256 subspace + per-layer importance + logistic scale mask)
- CCE (cut cross-entropy) loss; doc-isolation enforced via per-doc-reset
position_ids(flash varlen) - Final train loss ≈ 2.7–3.0
Hardware / runtime
- 2× RTX PRO 6000 Blackwell (sm_120), torch 2.11.0+cu128, transformers 5.10.x, peft 0.19.1
- Sliding-window layers routed to a Blackwell flash-attn build; global layers on SDPA (~2.4× vs all-SDPA)
Usage
from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer
base = AutoModelForCausalLM.from_pretrained("<gemma-4-12B-it path>", torch_dtype="bfloat16")
model = PeftModel.from_pretrained(base, "rpDungeon/marvin-cpt-12b-adapter")
tok = AutoTokenizer.from_pretrained("rpDungeon/marvin-cpt-12b-adapter")
A chat_template.jinja and the tokenizer are bundled with the adapter.
Framework versions
- PEFT 0.19.1
- Downloads last month
- 1