DigitalLearningGmbH/MATH-lighteval
Viewer β’ Updated β’ 25k β’ 31.8k β’ 66
How to use eugenemaver/Llama-3.1-8B-MATH with Transformers:
# Load model directly
from transformers import AutoModel
model = AutoModel.from_pretrained("eugenemaver/Llama-3.1-8B-MATH", device_map="auto")How to use eugenemaver/Llama-3.1-8B-MATH with llama.cpp:
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf eugenemaver/Llama-3.1-8B-MATH:Q4_K_M # Run inference directly in the terminal: llama cli -hf eugenemaver/Llama-3.1-8B-MATH:Q4_K_M
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf eugenemaver/Llama-3.1-8B-MATH:Q4_K_M # Run inference directly in the terminal: llama cli -hf eugenemaver/Llama-3.1-8B-MATH:Q4_K_M
# 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 eugenemaver/Llama-3.1-8B-MATH:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf eugenemaver/Llama-3.1-8B-MATH:Q4_K_M
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 eugenemaver/Llama-3.1-8B-MATH:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf eugenemaver/Llama-3.1-8B-MATH:Q4_K_M
docker model run hf.co/eugenemaver/Llama-3.1-8B-MATH:Q4_K_M
How to use eugenemaver/Llama-3.1-8B-MATH with Ollama:
ollama run hf.co/eugenemaver/Llama-3.1-8B-MATH:Q4_K_M
How to use eugenemaver/Llama-3.1-8B-MATH with Unsloth Studio:
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 eugenemaver/Llama-3.1-8B-MATH to start chatting
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 eugenemaver/Llama-3.1-8B-MATH to start chatting
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for eugenemaver/Llama-3.1-8B-MATH to start chatting
How to use eugenemaver/Llama-3.1-8B-MATH with Docker Model Runner:
docker model run hf.co/eugenemaver/Llama-3.1-8B-MATH:Q4_K_M
How to use eugenemaver/Llama-3.1-8B-MATH with Lemonade:
# Download Lemonade from https://lemonade-server.ai/ lemonade pull eugenemaver/Llama-3.1-8B-MATH:Q4_K_M
lemonade run user.Llama-3.1-8B-MATH-Q4_K_M
lemonade list
This model is a fine-tuned version of Llama 3.1 8B, optimized for math-related tasks using Unsloth. The fine-tuning process was 2x faster than standard approaches while maintaining strong accuracy.
You can load the model with Transformers:
from transformers import AutoModelForCausalLM, AutoTokenizer
MODEL_NAME = "eugenemaver/Llama-3.1-8B-MATH"
tokenizer = AutoTokenizer.from_pretrained(MODEL_NAME)
model = AutoModelForCausalLM.from_pretrained(MODEL_NAME, device_map="auto")
input_text = "Solve the equation: x^2 + 5x + 6 = 0"
inputs = tokenizer(input_text, return_tensors="pt").to(model.device)
output = model.generate(**inputs, max_length=100)
print(tokenizer.decode(output[0], skip_special_tokens=True))
If you want to use less memory (about 5GB) instead of ~20GB to load the model, use 4-bit using bitsandbytes:
from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig
bnb_config = BitsAndBytesConfig(load_in_4bit=True, bnb_4bit_compute_dtype="float16")
model = AutoModelForCausalLM.from_pretrained(MODEL_NAME, quantization_config=bnb_config, device_map="auto")
4-bit