ICEPVP8977/Uncensored_Small_Reasoning
Viewer • Updated • 4.54k • 33 • 6
How to use vpakarinen/qwen3-4b-lora-uncensored-thinking with PEFT:
from peft import PeftModel
from transformers import AutoModelForCausalLM
base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen3-4B-Thinking-2507")
model = PeftModel.from_pretrained(base_model, "vpakarinen/qwen3-4b-lora-uncensored-thinking")How to use vpakarinen/qwen3-4b-lora-uncensored-thinking with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="vpakarinen/qwen3-4b-lora-uncensored-thinking")
messages = [
{"role": "user", "content": "Who are you?"},
]
pipe(messages) # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("vpakarinen/qwen3-4b-lora-uncensored-thinking")
model = AutoModelForCausalLM.from_pretrained("vpakarinen/qwen3-4b-lora-uncensored-thinking")
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]:]))How to use vpakarinen/qwen3-4b-lora-uncensored-thinking with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "vpakarinen/qwen3-4b-lora-uncensored-thinking"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "vpakarinen/qwen3-4b-lora-uncensored-thinking",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/vpakarinen/qwen3-4b-lora-uncensored-thinking
How to use vpakarinen/qwen3-4b-lora-uncensored-thinking with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "vpakarinen/qwen3-4b-lora-uncensored-thinking" \
--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": "vpakarinen/qwen3-4b-lora-uncensored-thinking",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'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 "vpakarinen/qwen3-4b-lora-uncensored-thinking" \
--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": "vpakarinen/qwen3-4b-lora-uncensored-thinking",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use vpakarinen/qwen3-4b-lora-uncensored-thinking with Docker Model Runner:
docker model run hf.co/vpakarinen/qwen3-4b-lora-uncensored-thinking
axolotl version: 0.13.0.dev0
base_model: Qwen/Qwen3-4B-Thinking-2507
datasets:
- path: ICEPVP8977/Uncensored_Small_Reasoning
type: alpaca
output_dir: ./outputs/qwen-4b-thinking-lora-uncensored
sequence_len: 4096
adapter: lora
lora_r: 8
lora_alpha: 16
lora_dropout: 0.05
lora_target_modules:
- q_proj
- v_proj
- k_proj
- o_proj
- gate_proj
- down_proj
- up_proj
gradient_accumulation_steps: 1
micro_batch_size: 1
num_epochs: 1
optimizer: adamw_bnb_8bit
learning_rate: 0.0002
load_in_4bit: true
train_on_inputs: false
bf16: auto
Fine-tuned version of Qwen/Qwen3-4B-Thinking-2507 on the ICEPVP8977/Uncensored_Small_Reasoning dataset.
This lora model will fully uncensor the qwen3 4b thinking model, use alpaca instruction template.
Base model
Qwen/Qwen3-4B-Thinking-2507