Instructions to use prithivMLmods/QwQ-R1-Distill-1.5B-CoT with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use prithivMLmods/QwQ-R1-Distill-1.5B-CoT with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="prithivMLmods/QwQ-R1-Distill-1.5B-CoT") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("prithivMLmods/QwQ-R1-Distill-1.5B-CoT") model = AutoModelForCausalLM.from_pretrained("prithivMLmods/QwQ-R1-Distill-1.5B-CoT") 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
- vLLM
How to use prithivMLmods/QwQ-R1-Distill-1.5B-CoT with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "prithivMLmods/QwQ-R1-Distill-1.5B-CoT" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "prithivMLmods/QwQ-R1-Distill-1.5B-CoT", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/prithivMLmods/QwQ-R1-Distill-1.5B-CoT
- SGLang
How to use prithivMLmods/QwQ-R1-Distill-1.5B-CoT 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 "prithivMLmods/QwQ-R1-Distill-1.5B-CoT" \ --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": "prithivMLmods/QwQ-R1-Distill-1.5B-CoT", "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 "prithivMLmods/QwQ-R1-Distill-1.5B-CoT" \ --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": "prithivMLmods/QwQ-R1-Distill-1.5B-CoT", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use prithivMLmods/QwQ-R1-Distill-1.5B-CoT with Docker Model Runner:
docker model run hf.co/prithivMLmods/QwQ-R1-Distill-1.5B-CoT
QWQ R1 [Reasoning] Distill 1.5B CoT
QWQ R1 [Reasoning] Distill 1.5B CoT is a fine-tuned language model designed for advanced reasoning and instruction-following tasks. It leverages the Qwen2.5 R1 Distill from the DeepSeek base model and has been fine-tuned on chain-of-thought (CoT) reasoning datasets, focusing on CoT reasoning for problem-solving. This model is optimized for tasks requiring logical reasoning, detailed explanations, and multi-step problem-solving, making it ideal for applications such as instruction-following, text generation, and complex reasoning tasks.
Quickstart with Transformers
Here provides a code snippet with apply_chat_template to show you how to load the tokenizer and model and how to generate contents.
from transformers import AutoModelForCausalLM, AutoTokenizer
model_name = "prithivMLmods/QwQ-R1-Distill-1.5B-CoT"
model = AutoModelForCausalLM.from_pretrained(
model_name,
torch_dtype="auto",
device_map="auto"
)
tokenizer = AutoTokenizer.from_pretrained(model_name)
prompt = "How many r in strawberry."
messages = [
{"role": "system", "content": "You are a helpful and harmless assistant. You are Qwen developed by Alibaba. You should think step-by-step."},
{"role": "user", "content": prompt}
]
text = tokenizer.apply_chat_template(
messages,
tokenize=False,
add_generation_prompt=True
)
model_inputs = tokenizer([text], return_tensors="pt").to(model.device)
generated_ids = model.generate(
**model_inputs,
max_new_tokens=512
)
generated_ids = [
output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
]
response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
Intended Use
QWQ R1 [Reasoning] Distill 1.5B CoT is specifically designed for tasks requiring advanced reasoning, structured thinking, and detailed explanations. Its intended applications include:
- Instruction-Following Tasks: Performing step-by-step tasks based on user instructions.
- Logical Reasoning: Solving problems that demand multi-step logical processing and inference.
- Text Generation: Crafting coherent and contextually appropriate text for various domains.
- Educational Tools: Assisting in learning environments, providing explanations for complex topics, or guiding through reasoning exercises.
- Problem-Solving: Addressing computational or real-world problems requiring chain-of-thought reasoning.
- AI-Assisted Decision-Making: Supporting users in making informed decisions with logical analysis.
Limitations
While the model excels in reasoning and explanation tasks, it has certain constraints:
- Context Length: Limited ability to process or generate outputs for inputs exceeding its maximum token limit.
- Domain Knowledge: It may lack detailed expertise in niche domains not covered during training.
- Dependence on Training Data: Performance can be influenced by biases or gaps in the datasets it was fine-tuned on.
- Real-Time Reasoning: Struggles with tasks requiring dynamic understanding of real-time data or rapidly changing contexts.
- Mathematical Precision: May produce errors in calculations or fail to interpret ambiguous mathematical problems.
- Factual Accuracy: Occasionally generates incorrect or outdated information when dealing with facts.
- Language Nuances: Subtle linguistic or cultural nuances might be misunderstood or misrepresented.
- Complex CoT Chains: For extremely lengthy or convoluted reasoning chains, the model may lose track of earlier context or steps.
- Downloads last month
- 12
Model tree for prithivMLmods/QwQ-R1-Distill-1.5B-CoT
Base model
deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B