Text Generation
Transformers
Safetensors
English
qwen3
unsloth
trl
sft
code
reasoning
abliterated
baukit-abliterated
conversational
text-generation-inference
Instructions to use lunahr/Qwen3-0.6B-Code-Expert-abliterated with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use lunahr/Qwen3-0.6B-Code-Expert-abliterated with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="lunahr/Qwen3-0.6B-Code-Expert-abliterated") 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("lunahr/Qwen3-0.6B-Code-Expert-abliterated") model = AutoModelForCausalLM.from_pretrained("lunahr/Qwen3-0.6B-Code-Expert-abliterated", 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 lunahr/Qwen3-0.6B-Code-Expert-abliterated with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "lunahr/Qwen3-0.6B-Code-Expert-abliterated" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "lunahr/Qwen3-0.6B-Code-Expert-abliterated", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/lunahr/Qwen3-0.6B-Code-Expert-abliterated
- SGLang
How to use lunahr/Qwen3-0.6B-Code-Expert-abliterated 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 "lunahr/Qwen3-0.6B-Code-Expert-abliterated" \ --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": "lunahr/Qwen3-0.6B-Code-Expert-abliterated", "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 "lunahr/Qwen3-0.6B-Code-Expert-abliterated" \ --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": "lunahr/Qwen3-0.6B-Code-Expert-abliterated", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Unsloth Desktop
- Docker Model Runner
How to use lunahr/Qwen3-0.6B-Code-Expert-abliterated with Docker Model Runner:
docker model run hf.co/lunahr/Qwen3-0.6B-Code-Expert-abliterated
Upload readme
Browse files
README.md
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
tags:
|
| 4 |
+
- unsloth
|
| 5 |
+
- trl
|
| 6 |
+
- sft
|
| 7 |
+
- code
|
| 8 |
+
- reasoning
|
| 9 |
+
- abliterated
|
| 10 |
+
- baukit-abliterated
|
| 11 |
+
datasets:
|
| 12 |
+
- nvidia/OpenCodeReasoning
|
| 13 |
+
language:
|
| 14 |
+
- en
|
| 15 |
+
base_model:
|
| 16 |
+
- suayptalha/Qwen3-0.6B-Code-Expert
|
| 17 |
+
pipeline_tag: text-generation
|
| 18 |
+
library_name: transformers
|
| 19 |
+
---
|
| 20 |
+
|
| 21 |
+
# Qwen3-0.6B-Code-Expert (Abliterated)
|
| 22 |
+
|
| 23 |
+
This project performs full fine-tuning on the **Qwen3-0.6B** language model to enhance its code reasoning and generation capabilities. Training was conducted exclusively on the `nvidia/OpenCodeReasoning` dataset, and the model was optimized using the bfloat16 (bf16) data type.
|
| 24 |
+
Additionally, it has been abliterated to make it steer away from censorship.
|
| 25 |
+
|
| 26 |
+
## Training Procedure
|
| 27 |
+
|
| 28 |
+
1. **Dataset Preparation**
|
| 29 |
+
|
| 30 |
+
* `nvidia/OpenCodeReasoning` dataset was used.
|
| 31 |
+
* Each example consists of code snippets paired with detailed step-by-step reasoning in Chain-of-Thought (CoT) style.
|
| 32 |
+
|
| 33 |
+
2. **Model Loading and Configuration**
|
| 34 |
+
|
| 35 |
+
* Qwen3-0.6B base model weights were loaded via the `unsloth` library in bf16 precision.
|
| 36 |
+
* Full fine-tuning (`full_finetuning=True`) was applied to all layers for optimal adaptation to code reasoning.
|
| 37 |
+
|
| 38 |
+
3. **Supervised Fine-Tuning**
|
| 39 |
+
|
| 40 |
+
* Employed the Hugging Face TRL library with the Supervised Fine-Tuning (SFT) approach.
|
| 41 |
+
* The model was trained to generate correct code solutions along with the corresponding reasoning chains.
|
| 42 |
+
|
| 43 |
+
## Purpose and Outcome
|
| 44 |
+
|
| 45 |
+
* The model’s capacity for understanding, reasoning about, and generating code was significantly improved through specialized, single-dataset training in bf16 precision.
|
| 46 |
+
* Outputs include both intermediate reasoning steps and final code solutions, enabling transparent and interpretable code generation.
|
| 47 |
+
|
| 48 |
+
## License
|
| 49 |
+
|
| 50 |
+
This project is licensed under the Apache License 2.0. See the [LICENSE](./LICENSE) file for details.
|
| 51 |
+
|
| 52 |
+
## Support
|
| 53 |
+
|
| 54 |
+
<a href="https://www.buymeacoffee.com/suayptalha" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" alt="Buy Me A Coffee" style="height: 60px !important;width: 217px !important;" ></a>
|