Text Generation
Transformers
Safetensors
English
qwen2
qwq
reasoning
conversational
text-generation-inference
Run this model with HF Jobs
Run prithivMLmods/QwQ-Math-IO-500M on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs and TRL to fine-tune https://huggingface.co/prithivMLmods/QwQ-Math-IO-500M. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/prithivMLmods/QwQ-Math-IO-500M on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Evaluate on a benchmark
Use HF Jobs to evaluate https://huggingface.co/prithivMLmods/QwQ-Math-IO-500M. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Quantize for lower memory use
Use HF Jobs to create a 4-bit version of https://huggingface.co/prithivMLmods/QwQ-Math-IO-500M. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.
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)# pip install -U transformers accelerate # 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", 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 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 files26 unmodified lines27282930313233343536373839404142434418 unmodified lines6364656667686970713 unmodified lines757677787980818226 unmodified lines- Multilingual capabilities (over 29 languages).4. **Optimized for Long Context**: Supports input contexts up to 128K tokens with generation capability up to 8K tokens.---## **Datasets Used**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:1. **[amphora/QwQ-LongCoT-130K](https://huggingface.co/datasets/amphora/QwQ-LongCoT-130K)**: 133k samples focused on complex CoT reasoning.2. **[qingy2024/QwQ-LongCoT-Verified-130K](https://huggingface.co/datasets/qingy2024/QwQ-LongCoT-Verified-130K)**: 467k verified samples emphasizing detailed step-by-step reasoning.3. **[gghfez/QwQ-LongCoT-130K-cleaned](https://huggingface.co/datasets/gghfez/QwQ-LongCoT-130K-cleaned)**: 125k cleaned samples for high-accuracy reasoning tasks.---## **Running the Model**To run the model using the Transformers library:18 unmodified linesoutputs = model.generate(**input_ids, max_new_tokens=100)print(tokenizer.decode(outputs[0], skip_special_tokens=True))```---## **Limitations**1. **Bias and Fairness**: Despite fine-tuning efforts, biases from the training data may persist. Users should critically assess model outputs.3 unmodified lines5. **Safety Considerations**: Safety alignment has been performed, but users should monitor outputs to avoid inappropriate content.6. **Resource Requirements**: Running the model efficiently requires a GPU with sufficient memory.---## **Intended Use Cases**1. **Mathematical Assistance**: Solving equations, performing calculations, and explaining mathematical concepts.26 unmodified lines27282930313218 unmodified lines5152535455563 unmodified lines60616263646526 unmodified lines- Multilingual capabilities (over 29 languages).4. **Optimized for Long Context**: Supports input contexts up to 128K tokens with generation capability up to 8K tokens.## **Running the Model**To run the model using the Transformers library:18 unmodified linesoutputs = model.generate(**input_ids, max_new_tokens=100)print(tokenizer.decode(outputs[0], skip_special_tokens=True))```## **Limitations**1. **Bias and Fairness**: Despite fine-tuning efforts, biases from the training data may persist. Users should critically assess model outputs.3 unmodified lines5. **Safety Considerations**: Safety alignment has been performed, but users should monitor outputs to avoid inappropriate content.6. **Resource Requirements**: Running the model efficiently requires a GPU with sufficient memory.## **Intended Use Cases**1. **Mathematical Assistance**: Solving equations, performing calculations, and explaining mathematical concepts.
README.md-17