Instructions to use krishanwalia30/Qwen3-16bit-OpenMathReasoning-Finetuned-Merged with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use krishanwalia30/Qwen3-16bit-OpenMathReasoning-Finetuned-Merged with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="krishanwalia30/Qwen3-16bit-OpenMathReasoning-Finetuned-Merged") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("krishanwalia30/Qwen3-16bit-OpenMathReasoning-Finetuned-Merged") model = AutoModelForCausalLM.from_pretrained("krishanwalia30/Qwen3-16bit-OpenMathReasoning-Finetuned-Merged") 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]:])) - PEFT
How to use krishanwalia30/Qwen3-16bit-OpenMathReasoning-Finetuned-Merged with PEFT:
Task type is invalid.
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use krishanwalia30/Qwen3-16bit-OpenMathReasoning-Finetuned-Merged with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "krishanwalia30/Qwen3-16bit-OpenMathReasoning-Finetuned-Merged" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "krishanwalia30/Qwen3-16bit-OpenMathReasoning-Finetuned-Merged", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/krishanwalia30/Qwen3-16bit-OpenMathReasoning-Finetuned-Merged
- SGLang
How to use krishanwalia30/Qwen3-16bit-OpenMathReasoning-Finetuned-Merged 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 "krishanwalia30/Qwen3-16bit-OpenMathReasoning-Finetuned-Merged" \ --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": "krishanwalia30/Qwen3-16bit-OpenMathReasoning-Finetuned-Merged", "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 "krishanwalia30/Qwen3-16bit-OpenMathReasoning-Finetuned-Merged" \ --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": "krishanwalia30/Qwen3-16bit-OpenMathReasoning-Finetuned-Merged", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Unsloth Studio new
How to use krishanwalia30/Qwen3-16bit-OpenMathReasoning-Finetuned-Merged with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for krishanwalia30/Qwen3-16bit-OpenMathReasoning-Finetuned-Merged to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for krishanwalia30/Qwen3-16bit-OpenMathReasoning-Finetuned-Merged to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for krishanwalia30/Qwen3-16bit-OpenMathReasoning-Finetuned-Merged to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="krishanwalia30/Qwen3-16bit-OpenMathReasoning-Finetuned-Merged", max_seq_length=2048, ) - Docker Model Runner
How to use krishanwalia30/Qwen3-16bit-OpenMathReasoning-Finetuned-Merged with Docker Model Runner:
docker model run hf.co/krishanwalia30/Qwen3-16bit-OpenMathReasoning-Finetuned-Merged
krishanwalia30/Qwen3-16bit-OpenMathReasoning-Finetuned-Merged
🚀 Harness the Power of Qwen-3 with Enhanced Reasoning and Chat! 🚀
This model is a carefully fine-tuned version of the incredible Qwen-3-8B using cutting-edge techniques with Unsloth and Parameter-Efficient Fine-Tuning (PEFT) via LoRA. It's designed to bring you the best of both worlds: the strong general capabilities of Qwen-3 with a significant boost in logical reasoning and engaging conversational skills.
We've taken the already powerful Qwen-3 and further sculpted it using a blend of the unsloth/OpenMathReasoning-mini (Chain-of-Thought split) for advanced problem-solving and the mlabonne/FineTome-100k dataset to ensure natural and fluent interactions.
🔥 Key Features:
- Enhanced Reasoning: Excels at tasks requiring logical deduction and step-by-step thinking, thanks to fine-tuning on a dedicated reasoning dataset.
- Improved Chat: Maintains and enhances the general conversational abilities of Qwen-3, making it great for interactive applications.
- Efficient Fine-Tuning: Built using the incredibly efficient Unsloth library, resulting in faster training with less memory usage.
- PEFT (LoRA) Inside: Leverages Low-Rank Adaptation (LoRA) for parameter-efficient fine-tuning, making it easier to adapt to specific tasks without full model retraining.
- Ready to Use: Seamlessly integrates with the
transformerslibrary.
🛠️ How to Get Started:
Install the necessary libraries:
pip install transformers accelerate torch
Load and use the model:
from transformers import AutoModelForCausalLM, AutoTokenizer
model_name = "krishanwalia30/Qwen3-16bit-OpenMathReasoning-Finetuned-Merged"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(model_name, device_map="auto", torch_dtype="torch.float16")
messages = [
{"role": "user", "content": "Explain the Pythagorean theorem in simple terms."},
{"role": "assistant", "content": "Okay, here's a simple explanation:"},
{"role": "user", "content": "Now, solve for the hypotenuse if a=3 and b=4."},
]
text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(text, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=256, temperature=0.7, top_p=0.8, top_k=20, do_sample=True)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
⚙️ Fine-tuning Details:
- Base Model: Qwen-3-8B
- Fine-tuning Framework: Unsloth
- PEFT Strategy: LoRA
- Training Datasets:
- unsloth/OpenMathReasoning-mini (COT split)
- mlabonne/FineTome-100k
- Training Ratio: Approximately 30% reasoning data and 70% general chat data to balance capabilities.
- Training Infrastructure: Google Colab with a T4 GPU.
- Quantization during Training: Likely 4-bit quantization was employed during the fine-tuning process using Unsloth for memory efficiency. The final merged model is saved in 16-bit for broader compatibility.
- Key Hyperparameters:
per_device_train_batch_size: 2gradient_accumulation_steps: 4learning_rate: 2e-4max_steps: 30- Optimizer:
adamw_8bit - Learning Rate Scheduler:
linear - Warmup Steps: 5
- Weight Decay: 0.01
- Seed: 3407
📊 Evaluation:
While rigorous quantitative evaluations are ongoing, initial assessments indicate a significant improvement in the model's ability to handle reasoning-based questions while maintaining strong general conversational skills. Further benchmarks and community feedback are welcome!
👨💻 Author:
[https://huggingface.co/krishanwalia30]
🔗 Learn More:
For a deeper dive into the fine-tuning process and the rationale behind the choices, check out the article: [https://medium.com/@krishanw30/b1a8f684c3f1].
🙏 Acknowledgements:
A big thank you to the brilliant teams at Qwen, Unsloth AI, and the creators of the OpenMathReasoning-mini and FineTome-100k datasets for making this project possible!
Uploaded model
- Developed by: krishanwalia30
- License: apache-2.0
- Finetuned from model : unsloth/Qwen3-8B-unsloth-bnb-4bit
This qwen3 model was trained 2x faster with Unsloth and Huggingface's TRL library.
- Downloads last month
- 3
