Text Generation
Transformers
Safetensors
English
qwen2
qwq
reasoning
conversational
text-generation-inference
Instructions to use prithivMLmods/QwQ-Math-IO-500M with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use prithivMLmods/QwQ-Math-IO-500M with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="prithivMLmods/QwQ-Math-IO-500M") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("prithivMLmods/QwQ-Math-IO-500M") model = AutoModelForCausalLM.from_pretrained("prithivMLmods/QwQ-Math-IO-500M") 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 prithivMLmods/QwQ-Math-IO-500M with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "prithivMLmods/QwQ-Math-IO-500M" # 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-Math-IO-500M", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/prithivMLmods/QwQ-Math-IO-500M
- SGLang
How to use prithivMLmods/QwQ-Math-IO-500M 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-Math-IO-500M" \ --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-Math-IO-500M", "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-Math-IO-500M" \ --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-Math-IO-500M", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use prithivMLmods/QwQ-Math-IO-500M with Docker Model Runner:
docker model run hf.co/prithivMLmods/QwQ-Math-IO-500M
Update README.md
Browse files
README.md
CHANGED
|
@@ -27,18 +27,6 @@ QwQ-Math-IO-500M is a fine-tuned variant of Qwen2.5-0.5B, specifically optimized
|
|
| 27 |
- Multilingual capabilities (over 29 languages).
|
| 28 |
4. **Optimized for Long Context**: Supports input contexts up to 128K tokens with generation capability up to 8K tokens.
|
| 29 |
|
| 30 |
-
---
|
| 31 |
-
|
| 32 |
-
## **Datasets Used**
|
| 33 |
-
|
| 34 |
-
The model was fine-tuned on high-quality datasets explicitly curated for Chain of Thought (CoT) reasoning, mathematical problem-solving, and long-context tasks. Notable datasets include:
|
| 35 |
-
|
| 36 |
-
1. **[amphora/QwQ-LongCoT-130K](https://huggingface.co/datasets/amphora/QwQ-LongCoT-130K)**: 133k samples focused on complex CoT reasoning.
|
| 37 |
-
2. **[qingy2024/QwQ-LongCoT-Verified-130K](https://huggingface.co/datasets/qingy2024/QwQ-LongCoT-Verified-130K)**: 467k verified samples emphasizing detailed step-by-step reasoning.
|
| 38 |
-
3. **[gghfez/QwQ-LongCoT-130K-cleaned](https://huggingface.co/datasets/gghfez/QwQ-LongCoT-130K-cleaned)**: 125k cleaned samples for high-accuracy reasoning tasks.
|
| 39 |
-
|
| 40 |
-
---
|
| 41 |
-
|
| 42 |
## **Running the Model**
|
| 43 |
|
| 44 |
To run the model using the Transformers library:
|
|
@@ -63,9 +51,6 @@ input_ids = tokenizer(input_text, return_tensors="pt").to("cuda")
|
|
| 63 |
outputs = model.generate(**input_ids, max_new_tokens=100)
|
| 64 |
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
|
| 65 |
```
|
| 66 |
-
|
| 67 |
-
---
|
| 68 |
-
|
| 69 |
## **Limitations**
|
| 70 |
|
| 71 |
1. **Bias and Fairness**: Despite fine-tuning efforts, biases from the training data may persist. Users should critically assess model outputs.
|
|
@@ -75,8 +60,6 @@ print(tokenizer.decode(outputs[0], skip_special_tokens=True))
|
|
| 75 |
5. **Safety Considerations**: Safety alignment has been performed, but users should monitor outputs to avoid inappropriate content.
|
| 76 |
6. **Resource Requirements**: Running the model efficiently requires a GPU with sufficient memory.
|
| 77 |
|
| 78 |
-
---
|
| 79 |
-
|
| 80 |
## **Intended Use Cases**
|
| 81 |
|
| 82 |
1. **Mathematical Assistance**: Solving equations, performing calculations, and explaining mathematical concepts.
|
|
|
|
| 27 |
- Multilingual capabilities (over 29 languages).
|
| 28 |
4. **Optimized for Long Context**: Supports input contexts up to 128K tokens with generation capability up to 8K tokens.
|
| 29 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 30 |
## **Running the Model**
|
| 31 |
|
| 32 |
To run the model using the Transformers library:
|
|
|
|
| 51 |
outputs = model.generate(**input_ids, max_new_tokens=100)
|
| 52 |
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
|
| 53 |
```
|
|
|
|
|
|
|
|
|
|
| 54 |
## **Limitations**
|
| 55 |
|
| 56 |
1. **Bias and Fairness**: Despite fine-tuning efforts, biases from the training data may persist. Users should critically assess model outputs.
|
|
|
|
| 60 |
5. **Safety Considerations**: Safety alignment has been performed, but users should monitor outputs to avoid inappropriate content.
|
| 61 |
6. **Resource Requirements**: Running the model efficiently requires a GPU with sufficient memory.
|
| 62 |
|
|
|
|
|
|
|
| 63 |
## **Intended Use Cases**
|
| 64 |
|
| 65 |
1. **Mathematical Assistance**: Solving equations, performing calculations, and explaining mathematical concepts.
|