Instructions to use jayasuryajsk/Qwen2.5-3B-reasoner with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use jayasuryajsk/Qwen2.5-3B-reasoner with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="jayasuryajsk/Qwen2.5-3B-reasoner") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("jayasuryajsk/Qwen2.5-3B-reasoner") model = AutoModelForCausalLM.from_pretrained("jayasuryajsk/Qwen2.5-3B-reasoner") 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]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use jayasuryajsk/Qwen2.5-3B-reasoner with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "jayasuryajsk/Qwen2.5-3B-reasoner" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "jayasuryajsk/Qwen2.5-3B-reasoner", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/jayasuryajsk/Qwen2.5-3B-reasoner
- SGLang
How to use jayasuryajsk/Qwen2.5-3B-reasoner 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 "jayasuryajsk/Qwen2.5-3B-reasoner" \ --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": "jayasuryajsk/Qwen2.5-3B-reasoner", "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 "jayasuryajsk/Qwen2.5-3B-reasoner" \ --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": "jayasuryajsk/Qwen2.5-3B-reasoner", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Unsloth Studio
How to use jayasuryajsk/Qwen2.5-3B-reasoner 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 jayasuryajsk/Qwen2.5-3B-reasoner 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 jayasuryajsk/Qwen2.5-3B-reasoner to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for jayasuryajsk/Qwen2.5-3B-reasoner to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="jayasuryajsk/Qwen2.5-3B-reasoner", max_seq_length=2048, ) - Docker Model Runner
How to use jayasuryajsk/Qwen2.5-3B-reasoner with Docker Model Runner:
docker model run hf.co/jayasuryajsk/Qwen2.5-3B-reasoner
Uploaded model
- Developed by: jayasuryajsk
- License: apache-2.0
- Finetuned from model : unsloth/qwen2.5-3b-instruct-unsloth-bnb-4bit
Chess Reasoner Model
This model is a fine-tuned version of {base_model_name} trained to play chess using Unsloth. It reasons okay in math.
Model Description
- Base Model: {base_model_name}
- Training: Fine-tuned using GRPO (Generative Reinforcement Learning with Proximal Optimization)
- Task: Chess playing with reasoning
Usage
The model expects input in this format:
text = tokenizer.apply_chat_template([
{{"role": "system", "content": SYSTEM_PROMPT}},
{{"role": "user", "content": f"Analyze this chess position: {{board.fen()}}"}}
], tokenize=False)
The model will respond with:
<think>
[Analysis of the position]
</think>
<move>
[UCI format move e.g. e2e4]
</move>
Examples
[Add some example inputs and outputs here]
Limitations
- The model might occasionally suggest illegal moves
- Position evaluation might not be as strong as dedicated chess engines
- Reasoning can sometimes include incorrect assessments
Training Details
- Trained using Stockfish for move evaluation
It reasons surprisingly well in other domains too. Here are some examples.
Question : Little's law can be applied to any part of the store, such as a particular department or the checkout lines. The store owner determines that, during business hours, approximately 84 shoppers per hour make a purchase and each of these shoppers spend an average of 5 minutes in the checkout line. At any time during business hours, about how many shoppers, on average, are waiting in the checkout line to make a purchase at the Good Deals Store?
Response :
Reasoning
To solve this problem using Little's Law, we first need to understand that Little's Law states that the average number of items in a system (
L) is equal to the average arrival rate (λ) multiplied by the average time spent in the system (W). Mathematically, it can be expressed as:L = lambda x WWhere:
Lis the average number of shoppers in the checkout line,lambdais the average arrival rate (shoppers per unit time),Wis the average time spent in the checkout line (units of time).In this scenario:
The average arrival rate
lambdais 84 shoppers per hour. The average time spent in the checkout lineWis 5 minutes, which we need to convert to hours to match the units. Since there are 60 minutes in an hour, 5 minutes is (\frac{5}{60} = \frac{1}{12}) hours. Now, we can calculate the average number of shoppers in the checkout line (( L )):L = lambda x W = 84 x 1/ 12 = 7Thus, on average, there are 7 shoppers waiting in the checkout line.
Answer:7
This qwen2 model was trained 2x faster with Unsloth and Huggingface's TRL library.
- Downloads last month
- 3
