Instructions to use mlx-community/Qwen2-Math-7B-Instruct-8bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use mlx-community/Qwen2-Math-7B-Instruct-8bit with MLX:
# Make sure mlx-lm is installed # pip install --upgrade mlx-lm # Generate text with mlx-lm from mlx_lm import load, generate model, tokenizer = load("mlx-community/Qwen2-Math-7B-Instruct-8bit") prompt = "Write a story about Einstein" messages = [{"role": "user", "content": prompt}] prompt = tokenizer.apply_chat_template( messages, add_generation_prompt=True ) text = generate(model, tokenizer, prompt=prompt, verbose=True) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- MLX LM
How to use mlx-community/Qwen2-Math-7B-Instruct-8bit with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "mlx-community/Qwen2-Math-7B-Instruct-8bit"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "mlx-community/Qwen2-Math-7B-Instruct-8bit" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8080/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "mlx-community/Qwen2-Math-7B-Instruct-8bit", "messages": [ {"role": "user", "content": "Hello"} ] }' - Atomic Chat
Commit History
-
Upload folder using huggingface_hub (#1)
Verified signature- 33f3c6bfeafb855a39c488ae2b689348d51a4600118f2c9f3d156493396af309 (617f7aa02b9417e7d55fb0c1d33e715fff37fa1a) - c75554295a4f8a897ce94babd63431953c3e53d226ca6dac116964fc52432065 (123f639cd5bb9a3664351ca0bb5abadfa631f312) - 543fa0aba424f7685de77cb980bef70b7dc36faaaf090d3f0b7d4103f270368c (e76c3d89097d7dac454fed6175107ec2308e496f)0cbe319 -
initial commit
Verified signature9c0b88a