Instructions to use codewithdark/deepmath-7b-l with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use codewithdark/deepmath-7b-l with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="codewithdark/deepmath-7b-l")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("codewithdark/deepmath-7b-l", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use codewithdark/deepmath-7b-l with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "codewithdark/deepmath-7b-l" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "codewithdark/deepmath-7b-l", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/codewithdark/deepmath-7b-l
- SGLang
How to use codewithdark/deepmath-7b-l 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 "codewithdark/deepmath-7b-l" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "codewithdark/deepmath-7b-l", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "codewithdark/deepmath-7b-l" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "codewithdark/deepmath-7b-l", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use codewithdark/deepmath-7b-l with Docker Model Runner:
docker model run hf.co/codewithdark/deepmath-7b-l
metadata
library_name: transformers
tags:
- math
license: apache-2.0
datasets:
- openai/gsm8k
language:
- en
metrics:
- accuracy
base_model:
- deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B
pipeline_tag: text-generation
DeepMath-7B-L
Model Overview
DeepMath-7B-L are fine-tuned versions of DeepSeek-R1-Distill-Qwen-1.5B on the GSM8K dataset. These models are designed for mathematical reasoning and problem-solving, excelling in arithmetic, algebra, and word problems.
Model Details
- Base Model: DeepSeek-R1-Distill-Qwen-1.5B
- Fine-Tuning Dataset: GSM8K
- Parameters: 1.5 Billion
- Task: Mathematical Question Answering (Math QA)
- Repositories:
- DeepMath-7B-L (LoRA adapter-enhanced model)
- Commit Messages:
- "Full merged model for math QA"
- "Added LoRA adapters for math reasoning"
Training Details
- Dataset: GSM8K (Grade School Math 8K) - a high-quality dataset for mathematical reasoning
- Fine-Tuning Framework: Hugging Face Transformers & PyTorch
- Optimization Techniques:
- AdamW Optimizer
- Learning rate scheduling
- Gradient accumulation
- Mixed precision training (FP16)
- Training Steps: Multiple epochs on a high-performance GPU cluster
Capabilities & Performance
DeepMath-7B-L excel in:
- Solving word problems with step-by-step reasoning
- Performing algebraic and arithmetic computations
- Understanding complex problem structures
- Generating structured solutions with explanations
DeepMath-7B-L (LoRA Adapter-Enhanced Model)
from transformers import AutoModelForCausalLM, AutoTokenizer
tokenizer = AutoTokenizer.from_pretrained("codewithdark/deepmath-7b-l")
model = AutoModelForCausalLM.from_pretrained("codewithdark/deepmath-7b-l")
input_text = "Solve: 2x + 3 = 7"
inputs = tokenizer(input_text, return_tensors="pt")
outputs = model.generate(**inputs, max_length=100)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
Limitations
- May struggle with extremely complex mathematical proofs
- Performance is limited to the scope of GSM8K-type problems
- Potential biases in training data
Future Work
- Extending training to more diverse math datasets
- Exploring larger models for improved accuracy
- Fine-tuning on physics and higher-level mathematical reasoning datasets
License
This model is released under the Apache 2.0 License.
Citation
If you use these models, please cite:
@misc{DeepMath-7B-L,
author = {Ahsan},
title = {DeepMath-7B-L: LoRA Adapter Enhanced Model for Math Reasoning},
year = {2025},
url = {https://huggingface.co/codewithdark/deepmath-7b-l}
}