Instructions to use RichardErkhov/MathLLMs_-_MathCoder-CL-7B-gguf with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use RichardErkhov/MathLLMs_-_MathCoder-CL-7B-gguf with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="RichardErkhov/MathLLMs_-_MathCoder-CL-7B-gguf", filename="MathCoder-CL-7B.IQ3_M.gguf", )
output = llm( "Once upon a time,", max_tokens=512, echo=True ) print(output)
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- llama.cpp
How to use RichardErkhov/MathLLMs_-_MathCoder-CL-7B-gguf with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf RichardErkhov/MathLLMs_-_MathCoder-CL-7B-gguf:Q4_K_M # Run inference directly in the terminal: llama-cli -hf RichardErkhov/MathLLMs_-_MathCoder-CL-7B-gguf:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf RichardErkhov/MathLLMs_-_MathCoder-CL-7B-gguf:Q4_K_M # Run inference directly in the terminal: llama-cli -hf RichardErkhov/MathLLMs_-_MathCoder-CL-7B-gguf:Q4_K_M
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf RichardErkhov/MathLLMs_-_MathCoder-CL-7B-gguf:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf RichardErkhov/MathLLMs_-_MathCoder-CL-7B-gguf:Q4_K_M
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf RichardErkhov/MathLLMs_-_MathCoder-CL-7B-gguf:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf RichardErkhov/MathLLMs_-_MathCoder-CL-7B-gguf:Q4_K_M
Use Docker
docker model run hf.co/RichardErkhov/MathLLMs_-_MathCoder-CL-7B-gguf:Q4_K_M
- LM Studio
- Jan
- Ollama
How to use RichardErkhov/MathLLMs_-_MathCoder-CL-7B-gguf with Ollama:
ollama run hf.co/RichardErkhov/MathLLMs_-_MathCoder-CL-7B-gguf:Q4_K_M
- Unsloth Studio new
How to use RichardErkhov/MathLLMs_-_MathCoder-CL-7B-gguf 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 RichardErkhov/MathLLMs_-_MathCoder-CL-7B-gguf 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 RichardErkhov/MathLLMs_-_MathCoder-CL-7B-gguf to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for RichardErkhov/MathLLMs_-_MathCoder-CL-7B-gguf to start chatting
- Docker Model Runner
How to use RichardErkhov/MathLLMs_-_MathCoder-CL-7B-gguf with Docker Model Runner:
docker model run hf.co/RichardErkhov/MathLLMs_-_MathCoder-CL-7B-gguf:Q4_K_M
- Lemonade
How to use RichardErkhov/MathLLMs_-_MathCoder-CL-7B-gguf with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull RichardErkhov/MathLLMs_-_MathCoder-CL-7B-gguf:Q4_K_M
Run and chat with the model
lemonade run user.MathLLMs_-_MathCoder-CL-7B-gguf-Q4_K_M
List all available models
lemonade list
output = llm(
"Once upon a time,",
max_tokens=512,
echo=True
)
print(output)YAML Metadata Warning:empty or missing yaml metadata in repo card
Check out the documentation for more information.
Quantization made by Richard Erkhov.
MathCoder-CL-7B - GGUF
- Model creator: https://huggingface.co/MathLLMs/
- Original model: https://huggingface.co/MathLLMs/MathCoder-CL-7B/
| Name | Quant method | Size |
|---|---|---|
| MathCoder-CL-7B.Q2_K.gguf | Q2_K | 2.36GB |
| MathCoder-CL-7B.IQ3_XS.gguf | IQ3_XS | 2.6GB |
| MathCoder-CL-7B.IQ3_S.gguf | IQ3_S | 2.75GB |
| MathCoder-CL-7B.Q3_K_S.gguf | Q3_K_S | 2.75GB |
| MathCoder-CL-7B.IQ3_M.gguf | IQ3_M | 2.9GB |
| MathCoder-CL-7B.Q3_K.gguf | Q3_K | 3.07GB |
| MathCoder-CL-7B.Q3_K_M.gguf | Q3_K_M | 3.07GB |
| MathCoder-CL-7B.Q3_K_L.gguf | Q3_K_L | 3.35GB |
| MathCoder-CL-7B.IQ4_XS.gguf | IQ4_XS | 3.4GB |
| MathCoder-CL-7B.Q4_0.gguf | Q4_0 | 3.56GB |
| MathCoder-CL-7B.IQ4_NL.gguf | IQ4_NL | 3.58GB |
| MathCoder-CL-7B.Q4_K_S.gguf | Q4_K_S | 3.59GB |
| MathCoder-CL-7B.Q4_K.gguf | Q4_K | 3.8GB |
| MathCoder-CL-7B.Q4_K_M.gguf | Q4_K_M | 3.8GB |
| MathCoder-CL-7B.Q4_1.gguf | Q4_1 | 3.95GB |
| MathCoder-CL-7B.Q5_0.gguf | Q5_0 | 4.33GB |
| MathCoder-CL-7B.Q5_K_S.gguf | Q5_K_S | 4.33GB |
| MathCoder-CL-7B.Q5_K.gguf | Q5_K | 4.45GB |
| MathCoder-CL-7B.Q5_K_M.gguf | Q5_K_M | 4.45GB |
| MathCoder-CL-7B.Q5_1.gguf | Q5_1 | 4.72GB |
| MathCoder-CL-7B.Q6_K.gguf | Q6_K | 5.15GB |
| MathCoder-CL-7B.Q8_0.gguf | Q8_0 | 6.67GB |
Original model description:
license: apache-2.0 language: - en metrics: - accuracy pipeline_tag: text-generation
MathCoder: Seamless Code Integration in LLMs for Enhanced Mathematical Reasoning
Paper: https://arxiv.org/pdf/2310.03731.pdf
Repo: https://github.com/mathllm/MathCoder
Introduction
We introduce MathCoder, a series of open-source large language models (LLMs) specifically tailored for general math problem-solving.
| Base Model: Llama-2 | Base Model: Code Llama |
|---|---|
| MathCoder-L-7B | MathCoder-CL-7B |
| MathCoder-L-13B | MathCoder-CL-34B |
Training Data
The models are trained on the MathCodeInstruct Dataset.
Training Procedure
The models are fine-tuned with the MathCodeInstruct dataset using the original Llama-2 and CodeLlama models as base models. Check out our paper and repo for more details.
Evaluation
Usage
You can use the models through Huggingface's Transformers library. Use the pipeline function to create a text-generation pipeline with the model of your choice, then feed in a math problem to get the solution. Check our Github repo for datails.
Citation
Please cite the paper if you use our data, model or code. Please also kindly cite the original dataset papers.
@inproceedings{
wang2024mathcoder,
title={MathCoder: Seamless Code Integration in {LLM}s for Enhanced Mathematical Reasoning},
author={Ke Wang and Houxing Ren and Aojun Zhou and Zimu Lu and Sichun Luo and Weikang Shi and Renrui Zhang and Linqi Song and Mingjie Zhan and Hongsheng Li},
booktitle={The Twelfth International Conference on Learning Representations},
year={2024},
url={https://openreview.net/forum?id=z8TW0ttBPp}
}
@inproceedings{
zhou2024solving,
title={Solving Challenging Math Word Problems Using {GPT}-4 Code Interpreter with Code-based Self-Verification},
author={Aojun Zhou and Ke Wang and Zimu Lu and Weikang Shi and Sichun Luo and Zipeng Qin and Shaoqing Lu and Anya Jia and Linqi Song and Mingjie Zhan and Hongsheng Li},
booktitle={The Twelfth International Conference on Learning Representations},
year={2024},
url={https://openreview.net/forum?id=c8McWs4Av0}
}
- Downloads last month
- 155
2-bit
3-bit
4-bit
5-bit
6-bit
8-bit
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="RichardErkhov/MathLLMs_-_MathCoder-CL-7B-gguf", filename="", )