Instructions to use ping98k/gpt-j-6b-thinking-no-special-sft-lora with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use ping98k/gpt-j-6b-thinking-no-special-sft-lora with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("EleutherAI/gpt-j-6b") model = PeftModel.from_pretrained(base_model, "ping98k/gpt-j-6b-thinking-no-special-sft-lora") - Transformers
How to use ping98k/gpt-j-6b-thinking-no-special-sft-lora with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="ping98k/gpt-j-6b-thinking-no-special-sft-lora") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("ping98k/gpt-j-6b-thinking-no-special-sft-lora", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use ping98k/gpt-j-6b-thinking-no-special-sft-lora with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ping98k/gpt-j-6b-thinking-no-special-sft-lora" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ping98k/gpt-j-6b-thinking-no-special-sft-lora", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/ping98k/gpt-j-6b-thinking-no-special-sft-lora
- SGLang
How to use ping98k/gpt-j-6b-thinking-no-special-sft-lora 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 "ping98k/gpt-j-6b-thinking-no-special-sft-lora" \ --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": "ping98k/gpt-j-6b-thinking-no-special-sft-lora", "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 "ping98k/gpt-j-6b-thinking-no-special-sft-lora" \ --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": "ping98k/gpt-j-6b-thinking-no-special-sft-lora", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Unsloth Desktop
- Docker Model Runner
How to use ping98k/gpt-j-6b-thinking-no-special-sft-lora with Docker Model Runner:
docker model run hf.co/ping98k/gpt-j-6b-thinking-no-special-sft-lora
GPT-J 6B โ Thinking SFT LoRA (No-Special-Tokens)
LoRA adapter only. Merged full-weight model: ping98k/gpt-j-6b-thinking-no-special-sft
What is this?
LoRA adapter (r=32) for GPT-J 6B, trained with SFT to produce chain-of-thought
reasoning in a <think>...</think> block before the final answer.
Key design choice: <think>, </think>, <|im_start|>, <|im_end|> are
treated as plain text (normal BPE sub-word tokens), NOT added as special
embeddings. EOS is GPT-J's native <|endoftext|> (id=50256).
Inference with LoRA adapter
from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig
from peft import PeftModel
import torch
BASE_MODEL = "EleutherAI/gpt-j-6b"
LORA_REPO = "ping98k/gpt-j-6b-thinking-no-special-sft-lora"
tokenizer = AutoTokenizer.from_pretrained(LORA_REPO)
if tokenizer.pad_token is None:
tokenizer.pad_token = tokenizer.eos_token
bnb_cfg = BitsAndBytesConfig(
load_in_4bit=True,
bnb_4bit_compute_dtype=torch.bfloat16,
bnb_4bit_quant_type="nf4",
)
base = AutoModelForCausalLM.from_pretrained(
BASE_MODEL, quantization_config=bnb_cfg, device_map="auto"
)
model = PeftModel.from_pretrained(base, LORA_REPO)
model.eval()
messages = [{"role": "user", "content": "What is 2 + 2? Think step by step."}]
prompt = tokenizer.apply_chat_template(
messages, tokenize=False, add_generation_prompt=True
)
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
out = model.generate(
**inputs,
max_new_tokens=512,
temperature=0.7,
top_p=0.9,
do_sample=True,
eos_token_id=tokenizer.eos_token_id,
pad_token_id=tokenizer.pad_token_id,
stop_strings=["<|im_end|>"], # stop on plain-text end marker
tokenizer=tokenizer, # required for stop_strings
)
new_ids = out[0][inputs["input_ids"].shape[-1]:]
print(tokenizer.decode(new_ids, skip_special_tokens=False))
Note:
stop_strings=["<|im_end|>"]is also baked into the model'sgeneration_config.json. You still need to passtokenizer=tokenizertogenerate()for it to activate.
Training details
See the merged model card: ping98k/gpt-j-6b-thinking-no-special-sft
| Setting | Value |
|---|---|
| LoRA rank | 32 |
| LoRA alpha | 32 |
| Target modules | q_proj, k_proj, v_proj, out_proj, fc_in, fc_out |
| Epochs | 5 |
| Final loss | ~0.19 |
- Downloads last month
- 9
Model tree for ping98k/gpt-j-6b-thinking-no-special-sft-lora
Base model
EleutherAI/gpt-j-6b